【发布时间】:2021-12-18 06:05:57
【问题描述】:
我正在尝试使用 Python SDK 在 Azure 中创建恢复服务保管库。 包版本:azure-mgmt-recoveryservices==2.0.0
代码 sn-p:
client=RecoveryServicesClient(client_secret_credential, subscription_id)
client.vaults.begin_create_or_update(
resource_group_name="my-custom-rg",
vault_name="name_of_the_vault",
vault={
"location": "centralus",
"sku": {
"name": "Standard",
},
"identity": {
"type": "SystemAssigned",
}
}
)
我收到以下错误:
File "/<my-computer-path>/azure/lib/python3.8/site-packages/azure/mgmt/recoveryservices/operations/_vaults_operations.py", line 293, in _create_or_update_initial
raise HttpResponseError(response=response, error_format=ARMErrorFormat)
azure.core.exceptions.HttpResponseError: Operation returned an invalid status 'Bad Request'
我做错了什么?我该如何做更多的“错误调查”?
【问题讨论】:
-
可以参考How to Create recovery service vault using azure python SDK和azure-mgmt-recoveryservices。你也可以在 GitHub 上打开一个问题:azure-sdk-for-python
-
@DeepDave-MT:感谢您的帮助,基于单元测试我可以弄清楚。但是,我们有同样的问题,找不到任何代码示例,单元测试。所以,我打开了一个问题here
标签: azure azure-backup-vault azure-python-sdk