0

用于 .NET 的最新版本的 Azure Scheduler sdk有一些关于如何使用 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]"
                    };
4

1 回答 1

0

您仍然需要使用自签名证书来自 CA的证书来创建服务原则。

于 2017-07-21T18:34:51.900 回答