我正在尝试使用 ARM 模板将自定义脚本扩展添加到 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?