将Azure Scheduler与管理证书

时间:2017-07-12 03:42:27

标签: azure-scheduler

最新版本的Azure Scheduler sdk for .NET has some limited documentation如何使用AD凭据开始使用它,但有关如何设置该文档的文档并不是最新的。

我想让这更容易,如何使用SchedulerManagementClient初始化CertificateCredentials类?使用以下代码导致:

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

1 个答案:

答案 0 :(得分:0)

您仍需要使用self-signed certificatecertificate from a CA创建服务原则。