Articles → MICROSOFT AZURE → Run a custom script from Github in the Linux machine

Run a custom script from Github in the Linux machine






Github










apt-get update -y && apt-get upgrade -y
apt-get install -y nginx






Picture showing the code inside the file install_web.sh for installing nginx

Click to Enlarge


Customscript.json file




{
  "fileUris": [
    "https://raw.githubusercontent.com/guptakaran21/myrepo/main/install_web.sh"
  ],
  "commandToExecute": "./install_web.sh"
}



Run script in the PowerShell








Picture showing the upload menu for uploading a file in Azure cloudshell

Click to Enlarge



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

Query/Feedback


Your Email Id  
 
Subject 
 
Query/FeedbackCharacters remaining 250