当前位置: 首页>>代码示例>>C#>>正文


C# WindowsAzureSubscription类代码示例

本文整理汇总了C#中WindowsAzureSubscription的典型用法代码示例。如果您正苦于以下问题:C# WindowsAzureSubscription类的具体用法?C# WindowsAzureSubscription怎么用?C# WindowsAzureSubscription使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


WindowsAzureSubscription类属于命名空间,在下文中一共展示了WindowsAzureSubscription类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: AdalConfiguration

 public AdalConfiguration(WindowsAzureSubscription subscription)
     : this()
 {
     AdEndpoint = subscription.ActiveDirectoryEndpoint != null ? subscription.ActiveDirectoryEndpoint.TrimEnd('/') + '/' : null;
     AdDomain = subscription.ActiveDirectoryTenantId;
     ResourceClientUri = subscription.ActiveDirectoryServiceEndpointResourceId;
 }
开发者ID:EmmaZhu,项目名称:azure-sdk-tools,代码行数:7,代码来源:AdalConfiguration.cs

示例2: GetJobSubmissionClientCredentials

        public static IJobSubmissionClientCredential GetJobSubmissionClientCredentials(this IAzureHDInsightJobCommandCredentialsBase command, WindowsAzureSubscription currentSubscription, string cluster)
        {
            IJobSubmissionClientCredential clientCredential = null;
            if (command.Credential != null)
            {
                clientCredential = new BasicAuthCredential
                {
                    Server = GatewayUriResolver.GetGatewayUri(cluster),
                    UserName = command.Credential.UserName,
                    Password = command.Credential.GetCleartextPassword()
                };
            }
            else if (currentSubscription.IsNotNull())
            {
                var subscriptionCredentials = GetSubscriptionCredentials(command, currentSubscription);
                var asCertificateCredentials = subscriptionCredentials as HDInsightCertificateCredential;
                var asTokenCredentials = subscriptionCredentials as HDInsightAccessTokenCredential;
                if (asCertificateCredentials.IsNotNull())
                {
                    clientCredential = new JobSubmissionCertificateCredential(asCertificateCredentials, cluster);
                }
                else if (asTokenCredentials.IsNotNull())
                {
                    clientCredential = new JobSubmissionAccessTokenCredential(asTokenCredentials, cluster);
                }
            }

            return clientCredential;
        }
开发者ID:takekazuomi,项目名称:azure-sdk-tools,代码行数:29,代码来源:AzureHDInsightCommandExtensions.cs

示例3: Initialize

 public void Initialize()
 {
     var azureSub = new WindowsAzureSubscription();
     azureSub.ServiceEndpoint = new Uri("https://localhost:8090/");
     azureSub.SubscriptionId = Guid.NewGuid().ToString();
     this.subscription = new Subscription(azureSub);
 }
开发者ID:khaled-ibrahim,项目名称:azure-sdk-tools,代码行数:7,代码来源:GetAbsoluteUriTests.cs

示例4: WebsitesClient

 /// <summary>
 /// Creates new WebsitesClient
 /// </summary>
 /// <param name="subscription">Subscription containing websites to manipulate</param>
 /// <param name="logger">The logger action</param>
 public WebsitesClient(WindowsAzureSubscription subscription, Action<string> logger)
 {
     Logger = logger;
     cloudServiceClient = new CloudServiceClient(subscription, debugStream: logger);
     WebsiteManagementClient = subscription.CreateClient<WebSiteManagementClient>();
     this.subscription = subscription;
 }
开发者ID:kenazk,项目名称:azure-sdk-tools,代码行数:12,代码来源:WebsitesClient.cs

示例5: IsStorageServiceAvailable

 public bool IsStorageServiceAvailable(WindowsAzureSubscription subscription, string name)
 {
     EnsureCloudServiceClientInitialized(subscription);
     bool available = this.CloudServiceClient.CheckStorageServiceAvailability(name);
     WriteObject(!available);
     return available;
 }
开发者ID:takekazuomi,项目名称:azure-sdk-tools,代码行数:7,代码来源:TestAzureName.cs

示例6: ServerDataServiceCertAuth

 /// <summary>
 /// Initializes a new instance of the <see cref="ServerDataServicesCertAuth"/> class
 /// </summary>
 /// <param name="subscription">The subscription used to connect and authenticate.</param>
 /// <param name="serverName">The name of the server to connect to.</param>
 private ServerDataServiceCertAuth(
     WindowsAzureSubscription subscription,
     string serverName)
 {
     this.serverName = serverName;
     this.subscription = subscription;
 }
开发者ID:ranjitk9,项目名称:azure-sdk-tools,代码行数:12,代码来源:ServerDataServiceCertAuth.cs

示例7: GetSubscriptionCertificateCredentials

 public static IHDInsightSubscriptionCredentials GetSubscriptionCertificateCredentials(this IAzureHDInsightCommonCommandBase command, WindowsAzureSubscription currentSubscription)
 {
     return new HDInsightCertificateCredential
     {
         SubscriptionId = ResolveSubscriptionId(currentSubscription.SubscriptionId),
         Certificate = currentSubscription.Certificate,
         Endpoint = currentSubscription.ServiceEndpoint,
     };
 }
开发者ID:takekazuomi,项目名称:azure-sdk-tools,代码行数:9,代码来源:AzureHDInsightCommandExtensions.cs

示例8: AutomationClient

        public AutomationClient(
            WindowsAzureSubscription subscription,
            IAutomationManagementClient automationManagementClient)
        {
            Requires.Argument("automationManagementClient", automationManagementClient).NotNull();

            this.Subscription = subscription;
            this.automationManagementClient = automationManagementClient;
        }
开发者ID:NordPool,项目名称:azure-sdk-tools,代码行数:9,代码来源:AutomationClient.cs

示例9: ResourcesClient

        /// <summary>
        /// Creates new ResourceManagementClient
        /// </summary>
        /// <param name="subscription">Subscription containing resources to manipulate</param>
        public ResourcesClient(WindowsAzureSubscription subscription)
            : this(
                subscription.CreateClientFromResourceManagerEndpoint<ResourceManagementClient>(),
                new StorageClientWrapper(subscription.CreateClient<StorageManagementClient>()),
                new GalleryTemplatesClient(subscription),
                subscription.CreateClientFromResourceManagerEndpoint<EventsClient>())
        {

        }
开发者ID:kangyangthu,项目名称:azure-sdk-tools,代码行数:13,代码来源:ResourceClient.cs

示例10: EnsureCloudServiceClientInitialized

 private void EnsureCloudServiceClientInitialized(WindowsAzureSubscription subscription)
 {
     this.CloudServiceClient = this.CloudServiceClient ?? new CloudServiceClient(
         subscription,
         SessionState.Path.CurrentLocation.Path,
         WriteDebug,
         WriteVerbose,
         WriteWarning);
 }
开发者ID:takekazuomi,项目名称:azure-sdk-tools,代码行数:9,代码来源:TestAzureName.cs

示例11: GetAccessTokenCredentials

 public static IHDInsightSubscriptionCredentials GetAccessTokenCredentials(this IAzureHDInsightCommonCommandBase command, WindowsAzureSubscription currentSubscription)
 {
     var accessToken = currentSubscription.TokenProvider.GetCachedToken(currentSubscription,
                                                                currentSubscription.ActiveDirectoryUserId);
     return new HDInsightAccessTokenCredential()
     {
         SubscriptionId = ResolveSubscriptionId(currentSubscription.SubscriptionId),
         AccessToken = accessToken.AccessToken
     };
 }
开发者ID:takekazuomi,项目名称:azure-sdk-tools,代码行数:10,代码来源:AzureHDInsightCommandExtensions.cs

示例12: GetCachedToken

        public IAccessToken GetCachedToken(WindowsAzureSubscription subscription, string userId)
        {
            var key = tokenCache.Keys.FirstOrDefault(k => k.UserId == userId && k.TenantId == subscription.ActiveDirectoryTenantId);
            if (key == null)
            {
                throw new AadAuthenticationFailedException(string.Format(Resources.NoCachedToken,
                    subscription.SubscriptionName, userId));
            }

            return new AdalAccessToken(DecodeCachedAuthResult(key), this, new AdalConfiguration(subscription));
        }
开发者ID:AzureRT,项目名称:azure-sdk-tools,代码行数:11,代码来源:AdalTokenProvider.cs

示例13: Subscription

        internal Subscription(WindowsAzureSubscription azureSubscription)
        {
            if (azureSubscription == null)
            {
                throw new ArgumentNullException();
            }

            this.SubscriptionName = azureSubscription.SubscriptionName;
            this.SubscriptionId = azureSubscription.SubscriptionId;
            this.ServiceEndpoint = new Uri(String.Format("{0}/{1}/services/systemcenter/vmm", azureSubscription.ServiceEndpoint.ToString().TrimEnd(new[]{'/'}), SubscriptionId));
            this.Certificate = azureSubscription.Certificate;
            this.CredentialType = CredentialType.UseCertificate;
        }
开发者ID:EmmaZhu,项目名称:azure-sdk-tools,代码行数:13,代码来源:Subscription.cs

示例14: GetSubscriptionCredentials

        public static IHDInsightSubscriptionCredentials GetSubscriptionCredentials(this IAzureHDInsightCommonCommandBase command, WindowsAzureSubscription currentSubscription)
        {
            if (currentSubscription.Certificate.IsNotNull())
            {
                return GetSubscriptionCertificateCredentials(command, currentSubscription);
            }
            else if (currentSubscription.ActiveDirectoryUserId.IsNotNull())
            {
                return GetAccessTokenCredentials(command, currentSubscription);
            }

            throw new NotSupportedException();
        }
开发者ID:takekazuomi,项目名称:azure-sdk-tools,代码行数:13,代码来源:AzureHDInsightCommandExtensions.cs

示例15: ValidateSubscription

        /// <summary>
        /// Validates that the given subscription is valid.
        /// </summary>
        /// <param name="subscription">The <see cref="WindowsAzureSubscription"/> to validate.</param>
        public static void ValidateSubscription(WindowsAzureSubscription subscription)
        {
            if (subscription == null)
            {
                throw new ArgumentException(
                    Common.Properties.Resources.InvalidCurrentSubscription);
            }

            if (string.IsNullOrEmpty(subscription.SubscriptionId))
            {
                throw new ArgumentException(
                    Common.Properties.Resources.InvalidCurrentSubscriptionId);
            }
        }
开发者ID:kangyangthu,项目名称:azure-sdk-tools,代码行数:18,代码来源:SqlDatabaseCmdletBase.cs


注:本文中的WindowsAzureSubscription类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。