gpt4 book ai didi

c# - Microsoft.Azure.Management.Fluent.Azure 从不响应

转载 作者:行者123 更新时间:2023-12-03 02:37:15 25 4
gpt4 key购买 nike

我正在尝试使用“Microsoft.Azure.Management.Fluent”nuget 包来管理我的 web 应用程序和虚拟机。

我已尝试遵循这些示例,但它仍然对我不起作用 https://github.com/Azure/azure-libraries-for-net/blob/master/AUTH.md

我已在 Azure 门户中验证了我的 clientId、clientSecret 和tenantId,它们是有效的。

但是代码会阻塞在下面的“var azure = ...”行并且永远不会返回。

那么...我错过了什么?

    var credentials = SdkContext.AzureCredentialsFactory
.FromServicePrincipal(clientId,
clientSecret,
tentantId,
AzureEnvironment.AzureGlobalCloud);

var azure = Microsoft.Azure.Management.Fluent.Azure
.Configure()
.Authenticate(credentials)
.WithDefaultSubscription()
;

最佳答案

这是“.Configure()”调用。不知道我在哪里找到的,但这不再是他们建议的一部分。当我删除它时,它就起作用了。

var azure = Microsoft.Azure.Management.Fluent.Azure
//.Configure()
.Authenticate(credentials)
.WithDefaultSubscription()
;

关于c# - Microsoft.Azure.Management.Fluent.Azure 从不响应,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62836905/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com