我正在尝试使用Azure CLI和模板在Azure上创建Linux VM(CentOS 7)。我希望通过安装Node.js来启动虚拟机。为了实现这一点,我在template.json中使用了CustomScriptForLinux块。
{
"comments": "Generalized from resource: '/subscriptions/<sub-id>/resourceGroups/testing/providers/Microsoft.Compute/virtualMachines/smartforecastingui/extensions/CustomScriptForLinux'.",
"type": "Microsoft.Compute/virtualMachines/extensions",
"name": "testin/install",
"apiVersion": "2018-06-01",
"location": "eastus2",
"tags": {
"applicationname": "TestingApp"
},
"scale": null,
"properties": {
"autoUpgradeMinorVersion": true,
"settings": {
"fileUris": [
"https://raw.githubusercontent.com/nodesource/distributions/master/rpm/setup_10.x"
]
},
"publisher": "Microsoft.OSTCExtensions",
"type": "['CustomScriptForLinux']",
"typeHandlerVersion": "1.4",
"protectedSettings": {
"commandToExecute": "bash setup_10.x && yum upgrade && yum install -y gcc-c++ make nodejs yarn"
}
},
}
当我尝试使用命令创建虚拟机
az group deployment create --resource-group testing --template-file template.json --parameters parameters.json
它失败并显示错误:
Failed to download external file with uri: https://raw.githubusercontent.com/nodesource/distributions/master/rpm/setup_10.x
with error 'ascii' codec can't decode byte 0xe2 in position 2815: ordinal not in range(128)\n\".
我该如何解决?