Articles → MICROSOFT AZURE → Run A Custom Script From GitHub In The Linux Machine

Run A Custom Script From GitHub In The Linux Machine


  1. Create a new repository myrepo
  2. Create a new file with the name
  3. Inside the file, write the following command
  4. apt-get update -y && apt-get upgrade -y
    apt-get install -y nginx

  5. Commit the file
  6. Get the raw URL of the file
  7. Picture showing the code inside the file for installing nginx
    Click to Enlarge

Customscript.Json File

  "fileUris": [
  "commandToExecute": "./"

Run Script In The Powershell

  1. Open the cloud shell in the Azure portal
  2. In the PowerShell mode, upload the customscript.json
  3. Picture showing the upload menu for uploading a file in Azure cloudshell
    Click to Enlarge

  4. Inside the PowerShell, execute the following command
  5. az vm extension set --resource-group RG --vm-name myvm --name customScript --publisher Microsoft.Azure.Extensions --settings customscript.json

Picture showing the custom script provisioned in Extensions in virtual machine
Click to Enlarge

Posted By  -  Karan Gupta
Posted On  -  Wednesday, April 21, 2021


Your Email Id  
Query/FeedbackCharacters remaining 250