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]"
};