public SubscriptionCloudCredentials GetManagementCredentials() { var subscription = ActiveSubscription; var settings = new Dictionary <string, object> { { "SubscriptionId", subscription.SubscriptionId }, { "ManagementCertificate", subscription.ManagementCertificate.Thumbprint ?? subscription.ManagementCertificate.Base64Data } }; var credentials = CertificateCloudCredentials.Create(settings); if (credentials == null) { var message = String.Format("The Subscription for '{0}' did not have valid subscription details configured.", subscription.Name); _logger.ErrorFormat(message); throw new CredentialException(message); } return(credentials); }
/// <summary> /// Creates a new credentials instance if the appropriate settings for /// this provider are present and valid. /// </summary> /// <param name="settings">Dictionary of configuration settings.</param> /// <returns>Returns a new instance if the provider supports the /// provided settings.</returns> public CloudCredentials CreateCredentials(IDictionary <string, object> settings) { return(CertificateCloudCredentials.Create(settings)); }