0

没有为 Azure ARM 模板部署定义错误“resourceGroupName”

File "./__main__.py", line 23, in <module>
        resourceGroupName: resource_group.name,
    NameError: name 'resourceGroupName' is not defined
  

代码的相关部分在这里,不确定在哪里寻找 TemplateDeployment 文档,在 API 参考中看不到它们

armDeployment = azure.core.TemplateDeployment("test-dep", {
    resourceGroupName: resource_group.name,
    templateBody: JSON.stringify(content),
    parameters: {
        "storageAccountType": "Standard_GRS",
    },
    deploymentMode: "Incremental",
})
4

1 回答 1

3

如文档中所示,资源组的正确属性名称是:resource_group_nametemplate_body不是templateBody。因此,如果您像这样更改它,它应该可以工作:

armDeployment = azure.core.TemplateDeployment("test-dep", {
     resource_group_name: resource_group.name,
     template_body: JSON.stringify(content),
     parameters: {
        "storageAccountType": "Standard_GRS",
     },
     deployment_mode: "Incremental",
})
于 2020-08-15T15:36:58.810 回答