我希望能夠部署一個複雜的ARM模板,利用本地Visual Studio中的DSC擴展和嵌套模板。 該示例設置爲從GitHub下載資產: https://github.com/Azure/azure-quickstart-templates/tree/master/active-directory-new-domain-ha-2-dc 我必須做些什麼更改才能將資源綁定到本地Visual Studio項目並使用它們而不是從GitHub下載它們? 這裏是帶下來的模板版本負責下載:Azure RM模板。如何使用VS自動上傳資源,而不是從GitHub獲取資源
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
...
"adPDCVMName": {
"type": "string",
"metadata": {
"description": "The computer name of the PDC"
},
"defaultValue": "adPDC"
},
"assetLocation": {
"type": "string",
"metadata": {
"description": "The location of resources such as templates and DSC modules that the script is dependent"
},
"defaultValue": "https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/active-directory-new-domain-ha-2-dc"
}
...
},
"variables": {
...
"adPDCModulesURL": "[concat(parameters('assetLocation'),'/DSC/CreateADPDC.ps1.zip')]",
"adPDCConfigurationFunction": "CreateADPDC.ps1\\CreateADPDC",
...
},
"resources": [
...
{
"name": "[parameters('adPDCVMName')]",
"type": "Microsoft.Compute/virtualMachines",
...
"resources": [
{
"name": "[concat(parameters('adPDCVMName'),'/CreateADForest')]",
"type": "Microsoft.Compute/virtualMachines/extensions",
...
"properties": {
...
"settings": {
"ModulesUrl": "[variables('adPDCModulesURL')]",
"ConfigurationFunction": "[variables('adPDCConfigurationFunction')]",
...
}
}
}
}
}
]
}
]
}
謝謝Naber先生!這是一個了不起的答案!你能否詳細說明步驟2?如何「將目錄中的文件設置爲內容」? – WinBoss
選擇文件的屬性。在內容上設置生成操作。 –
看看這個github示例:https://github.com/Azure/azure-quickstart-templates/tree/master/active-directory-new-domain - 它使用模式帕斯卡描述,而使用github的默認位置。 –