azure - 由于“ClientSecretCredential”问题,无法执行 Azure ARM 部署
问题描述
我想使用 Python 执行 Azure ARM 模板部署。我正在使用“ClientSecretCredential”库来构建我的 Azure 凭据。我正在使用“ClientSecretCredential”,因为根据这篇文章,看起来我们构建凭据的方式已经从azure.common (ServicePrincipalCredentials)
到azure-identity (ClientSecretCredential)
执行部署时,我收到了错误:
Message='ClientSecretCredential' object has no attribute 'signed_session'
Source=C:\Users\manjug\Desktop\SQLServer_armtemplate\testFunction.py
StackTrace:
File "C:\Users\manjug\Desktop\SQLServer_armtemplate\testFunction.py", line 109, in executeArmDeployment
Deployment(properties=deployment_properties)
File "C:\Users\manjug\Desktop\SQLServer_armtemplate\testFunction.py", line 119, in <module> (Current frame)
executeArmDeployment('coe-extollo-apis-dev', resourceManagerClient)
解决方案
我能够通过以下方式解决这个问题:
- 将“azure-mgmt-resource”模块更新为 16.0.0
- 将“deployments.create_or_update”函数更改为“deployments.begin_create_or_update”