Articles → MICROSOFT AZURE → Custom Script Extension In Azure
Custom Script Extension In Azure
Purpose
Scenario
Custom Powershell Script
Import-Module ServerManager
Install-WindowsFeature -Name Web-Server -IncludeAllSubFeature -IncludeManagementTools
Create A Storage Account
- Create the storage account
Click to Enlarge
- Inside the storage account, create the container
Click to Enlarge
- Inside the container, upload the script
Click to Enlarge
Execute Custom Script In Virtual Machine
- Go inside the detail screen of the virtual machine
- Go to the Extensions
Click to Enlarge
- Click on the + Add button
Click to Enlarge
- In the next window, click on the Custom Script Extension
Click to Enlarge
- A custom script extension screen will come. Click on the Create button
Click to Enlarge
- Another screen will come to select the script file
Click to Enlarge
- Click on the Browse button. Once you click on the bottom, you can select the storage account → container → script
Click to Enlarge
- Once the script is selected, you can click on the Ok button
Click to Enlarge
- Once you click on the Ok button, the script will be deployed and start executing
- Once the script deployment is completed, you will get the following message
Click to Enlarge
Output
Click to Enlarge