0

The newest version of the Azure Scheduler sdk for .NET has some limited documentation on how to get started with it using AD credentials, but the documentation on how to get that set up is not up to date.

I'd like to instead make this easier, how can I initialize the SchedulerManagementClient class using CertificateCredentials? Using the following code results in:

Microsoft.Rest.Azure.CloudException : Authentication failed. The 'Authorization' header is missing.`

var store = new X509Store(StoreName.My, StoreLocation.CurrentUser);
store.Open(OpenFlags.ReadWrite);
var certificate = store.Certificates.Find(X509FindType.FindByThumbprint, "FD29EECE44EA71F31C20AB4EA0501E576CFB6B79", false)[0];
store.Close();
var cloudCreds = new CertificateCredentials(certificate);

                    _scheduler = new SchedulerManagementClient(cloudCreds)
                    {
                        SubscriptionId = "[my subscription id]"
                    };
The Muffin Man
  • 19,585
  • 30
  • 119
  • 191

1 Answers1

0

You will still need to create a service principle using either self-signed certificate or certificate from a CA.

Derek Li
  • 3,089
  • 2
  • 25
  • 38