Azure CLI部署Template Spec报错:Unable to retrieve the template artifact
Azure CLI部署Template Spec时遇到
Unable to retrieve the template artifact错误求助 使用Azure CLI通过Template Spec部署资源时,触发错误:Unable to retrieve the template artifact。涉及的Template Spec名称为test,主模板及所有链接模板均保存在本地电脑中。
主模板代码 (main_template.json)
{ "$schema": "https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#", "contentVersion": "1.0.0.0", "parameters": { "env":{ "type": "string" }, "location": { "type": "string", "defaultValue": "[resourceGroup().location]" } }, "variables": {}, "resources": [ { "type": "Microsoft.Resources/deployments", "apiVersion": "2020-06-01", "name": "storage", "properties": { "mode": "Incremental", "templateLink": { "relativePath": "linked/linkedtemplate_storage.json" }, "parameters": { "env": { "value": "[parameters('env')]" }, "location": { "value": "[parameters('location')]" } } } }, { "type": "Microsoft.Resources/deployments", "apiVersion": "2020-06-01", "name": "monitoring", "properties": { "mode": "Incremental", "templateLink": { "relativePath": "linked/linkedtemplate_monitoring.json" }, "parameters": { "env": { "value": "[parameters('env')]" }, "location": { "value": "[parameters('location')]" } } } }, { "type": "Microsoft.Resources/deployments", "apiVersion": "2020-06-01", "name": "notification", "properties": { "mode": "Incremental", "templateLink": { "relativePath": "linked/linkedtemplate_notification.json" }, "parameters": { "env": { "value": "[parameters('env')]" } } } } ] }
本地文件路径
- 主模板:
C:\Users\template\maintemplate.json - 存储链接模板:
C:\Users\template\linked\linkedtemplate_storage.json - 监控链接模板:
C:\Users\template\linked\linkedtemplate_monitoring.json - 通知链接模板:
C:\Users\template\linked\linkedtemplate_notification.json
部署命令
$id = $(az ts show --name test --resource-group rg-nonprod-japan-rubiconclientbridge01-na-idbridge-n01-devops --version "1.0" --query "id") az deployment group create \ --resource-group rg-nonprod-japan-rubiconclientbridge01-na-idbridge-n01-infrastructure \ --template-spec $id \ --parameters "@.\\maintemplate.parameters-dev.json" \
我确认主模板中链接模板的相对路径是正确的,但无法定位错误原因,希望能得到解决办法,如需更多信息可随时提供。
内容的提问来源于stack exchange,提问作者user19504539
相关产品推荐
相关产品推荐

