我正在研究 ARM 模板并使用 VSTS 来部署它们。这里使用 ARM 模板,我想将 Azure Kubernetes 服务部署到我的门户中。使用 PowerShell 在本地部署它们时成功部署,但是当我尝试使用 VSTS CD 管道做同样的事情时,会遇到如下问题:
失败:'315' 行和'9' 列的模板资源'SolutionDeployment' 无效。用于部署模板的 api-version '2016-07-01' 不支持 'SubscriptionId' 属性。请使用 api-version '2017-05-10' 或更高版本来部署模板。
但是,我使用最新版本作为解决方案部署的 API 版本,这里是:
{
"type": "Microsoft.Resources/deployments",
"name": "SolutionDeployment",
"apiVersion": "2017-05-10",
"resourceGroup": "[split(variables('omsWorkspaceId'),'/')[4]]",
"subscriptionId": "[split(variables('omsWorkspaceId'),'/')[2]]",
"properties": {
"mode": "Incremental",
"template": {
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {},
"variables": {},
"resources": [
{
"apiVersion": "2017-03-15-preview",
"type": "Microsoft.OperationsManagement/solutions",
"location": "[parameters('workspaceRegion')]",
"name": "[concat('ContainerInsights', '(', split(variables('omsWorkspaceId'),'/')[8], ')')]",
"properties": {
"workspaceResourceId": "[variables('omsWorkspaceId')]"
},
"plan": {
"name": "[concat('ContainerInsights', '(', split(variables('omsWorkspaceId'),'/')[8], ')')]",
"product": "[concat('OMSGallery/', 'ContainerInsights')]",
"promotionCode": "",
"publisher": "Microsoft"
}
}
]
}
},
"dependsOn": [ "[concat('Microsoft.Resources/deployments/', 'WorkspaceDeployment')]" ]
}
谁能建议我“如何摆脱这个问题?”