我正在使用arm模板构建多个vm并将它们加入到现有域中,但是由于以下错误而失败。
模板抱怨的资源存在。
要加入的模板如下所示。
{
"apiVersion": "2015-06-15",
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[toLower(concat(variables('varnodeNamePrefix'),copyIndex(1),'.',variables('varlocation'),'.cloudapp.azure.com','/joindomain'))]",
"location": "[variables('varlocation')]",
"dependsOn": [
"[resourceId('Microsoft.Compute/virtualMachines', concat(variables('varnodeNamePrefix'),copyIndex(1)))]",
"[resourceId('Microsoft.Storage/storageAccounts', concat(variables('varstorageName'),copyIndex(1)))]"
],
"properties": {
"publisher": "Microsoft.Compute",
"type": "JsonADDomainExtension",
"typeHandlerVersion": "1.3",
"autoUpgradeMinorVersion": true,
"settings": {
"Name": "[variables('vardomainToJoin')]",
"OUPath": "[variables('varouPath')]",
"User": "[variables('vardomainUsername')]",
"Restart": "true",
"Options": "[variables('vardomainJoinOptions')]"
},
"protectedSettings": {
"Password": "[variables('vardomainPassword')]"
}
},
"copy": {
"name": "dominjoin",
"count": "[variables('varvmCount')]"
}
}
谢谢
答案 0 :(得分:1)
您的扩展名应为:vm_name/extension_name
,因此对于您来说,应为:
"name": "[toLower(concat(variables('varnodeNamePrefix'),copyIndex(1),'/joindomain'))]",
这对于天蓝色的所有子资源均有效。要标识此扩展所属的“虚拟机”,它需要虚拟机资源名称,而不是fqdn或ip地址或类似名称(因为其Azure级操作)。