我正在尝试使用 Azure CLI 和模板在 Azure 上创建 Linux VM (CentOS 7)。我希望在安装了 Node.js 的情况下启动 VM。为了实现这一点,我在 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\".
我怎样才能解决这个问题 ?