Unable to install Node.js on Azure VM using CustomScriptForLinux

320 Views Asked by At

I am trying to create a Linux VM (CentOS 7) on Azure using Azure CLI and a template. I want the VM to be spun up with Node.js installed. In order to achieve this I used a CustomScriptForLinux block as below in the template.json.

{
  "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"
    }
  },
}

When I try to create a VM with the command

az group deployment create --resource-group testing --template-file template.json --parameters parameters.json

It fails with the error :

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\".

How can I fix this ?

0

There are 0 best solutions below