我想部署使用ARM模板將自定義腳本擴展添加到Azure VM,並且我想讓它使用SAS令牌從存儲帳戶下載文件。Azure VM自定義腳本擴展SAS令牌支持
這裏是模板(簡化):
{
"name": "CustomScriptExtension"
"type": "Microsoft.Compute/virtualMachines/extensions",
"location": "eastus",
"properties": {
"publisher": "Microsoft.Compute",
"type": "CustomScriptExtension",
"typeHandlerVersion": "1.8",
"settings": {
"fileUris": [
"https://{storage-account}.blob.core.windows.net/installers/{installer}.msi?sv=2015-04-05&sig={signature}&st=2017-05-03T05:18:28Z&se=2017-05-10T05:18:28Z&srt=o&ss=b&sp=r"
],
"commandToExecute": "start /wait msiexec /package {installer}.msi /quiet"
},
}
}
和部署它會導致這個錯誤:
{
"name": "CustomScriptExtension",
"type": "Microsoft.Compute.CustomScriptExtension",
"typeHandlerVersion": "1.8",
"statuses": [
{
"code": "ProvisioningState/failed/3",
"level": "Error",
"displayStatus": "Provisioning failed",
"message": "Failed to download all specified files. Exiting. Error Message: Missing mandatory parameters for valid Shared Access Signature"
}
]
}
如果我打與SAS的URL令牌其直接拉低文件只是好,所以我知道SAS令牌是正確的。自定義腳本擴展是否不支持包含SAS令牌的URL?
非常好,非常感謝。這解決了我的問題! –