我正在尝试使用“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/