2017-02-28 50 views

回答

1

沒有辦法直接做到這一點。但是你可以部署腳本擴展(S)或DSC擴展(S),將做的工作適合你。腳本擴展參考模板(相關部分):

{ 
    "type": "Microsoft.Compute/virtualMachines/extensions", 
    "name": "[concat(variables('vmName'),'/', variables('extensionName'))]", 
    "apiVersion": "[variables('apiVersion')]", 
    "location": "[resourceGroup().location]", 
    "dependsOn": [ 
    "[concat('Microsoft.Compute/virtualMachines/', variables('vmName'))]" 
    ], 
    "properties": { 
    "publisher": "Microsoft.Azure.Extensions", 
    "type": "CustomScript", 
    "typeHandlerVersion": "2.0", 
    "autoUpgradeMinorVersion": true, 
    "settings": { 
     "fileUris": "[split(parameters('fileUris'), ' ')]", 
     "commandToExecute": "[parameters('commandToExecute')]" 
    }, 
    "protectedSettings": { 
     "storageAccountName": "[parameters('customScriptStorageAccountName')]", 
     "storageAccountKey": "[parameters('customScriptStorageAccountKey')]" 
    } 
    } 
} 

參考:https://github.com/Azure/azure-quickstart-templates/tree/master/201-customscript-extension-azure-storage-on-ubuntu

+0

這正是我一直在尋找for..many謝謝:) –

+0

馬克是在這種情況下的答案;)@AnimeshJain – 4c74356b41

+0

完成。再次感謝 –