我想首先部署一个资源组,然后部署一堆资源(例如一个存储帐户和一个密钥库),最后创建一些Key Vault机密(使用上一步中创建的存储帐户的密钥进行秘密处理)。
这就是我定义资源的方式
"resources": [
{
"type": "Microsoft.Resources/resourceGroups",
"apiVersion": "2018-05-01",
"location": "[parameters('RgLocation')]",
"name": "[variables('RgName')]",
"properties": {},
"tags": "[variables('ResourceTags')]"
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2018-05-01",
"name": "resourcesDeployment",
"resourceGroup": "[variables('RgName')]",
"dependsOn": [
"[resourceId('Microsoft.Resources/resourceGroups', variables('RgName'))]"
],
"properties": {
...
}
},
{
"type": "Microsoft.Resources/deployments",
"apiVersion": "2018-05-01",
"name": "secretsDeployment",
"resourceGroup": "[variables('RgName')]",
"dependsOn": [
"[resourceId('Microsoft.Resources/deployments', 'resourcesDeployment')]"
],
"properties": {
...
}
}
]
resourcesDeployment“依赖”资源组,该组正常/按预期工作。
secretsDeployment“取决于” resourcesDeployment,这是失败的部分。我收到此错误:
部署模板验证失败:未在以下位置定义资源'Microsoft.Resources / deployments / resourcesDeployment' 模板。
如何确保这些部署按顺序进行。
非常感谢您的帮助