【发布时间】:2023-03-04 23:59:02
【问题描述】:
域加入应该等到自定义脚本扩展完成。请参阅下面的代码。我无法理解资源和子资源依赖项如何工作以及如何命名资源。不胜感激,如果你能指导我一篇文章来学习。
{
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(variables('varnodeNamePrefix'),copyindex(1),'/cse')]",
"apiVersion": "2017-03-30",
"location": "[variables('varlocation')]",
"dependsOn": [
"[concat(variables('varnodeNamePrefix'),copyindex(1))]"
],
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.8",
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [
"https://XXXXXXXXXXX.blob.core.windows.net/powershelscripts/sqlcluster/InstallAdditionalModules.ps1"
]
},
"protectedSettings": {
"commandToExecute": "powershell.exe -ExecutionPolicy Unrestricted ./sqlcluster/InstallAdditionalModules.ps1",
"storageAccountName": "sdfsdfsdfsdf",
"storageAccountKey": "sdsdfsdf/BH9C+fdgdfgdfgdfg+fgdfgdfg=="
}
},
"copy": {
"name": "WinFeatures",
"count":"[variables('varvmCount')]"
}
},
{
"apiVersion": "2015-06-15",
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "[concat(variables('varnodeNamePrefix'),copyindex(1),'/joindomain')]",
"location": "[resourceGroup().location]",
"dependsOn": ["[concat(variables('varnodeNamePrefix'),copyindex(1),'/cse')]"
],
"properties": {
"publisher": "Microsoft.Compute",
"type": "JsonADDomainExtension",
"typeHandlerVersion": "1.3",
"autoUpgradeMinorVersion": true,
"settings": {
"Name": "[variables('vardomainToJoin')]",
"User": "[concat(variables('vardomainToJoin'), '\\', variables('vardomainUsername'))]",
"Restart": "true",
"Options": "[variables('vardomainJoinOptions')]"
},
"protectedSettings": {
"Password": "[variables('vardomainPassword')]"
}
},
"copy": {
"name": "joindomain",
"count":"[variables('varvmCount')]"
}
【问题讨论】:
标签: azure azure-resource-manager arm-template azure-template