Azure VM From PowerShell Continued.
- Refer Here for the PowerShell script created in the class.
Creating Custom VM Images
- In Azure We have two types of images
- Generalized:
- This image requires setup to be completed on first boot
- For example on boot you can set the hostname, admin user and VM specific configurations
- Azure agent will process the parameters and signal back to the Azure Platform that the initial configuration has completed. (Provisioning)
- There are two Provisioners
- Azure Linux Agent (Linux VMS)
- cloud-init
- Specialized: These are the images completely configured and do not require special parameters to pass during first boot. Provisioning agents are not required for these images.
- Generalized:
- Lets create a Linux VM and install Lamp Stack in that
sudo apt update
sudo apt install apache2 -y
sudo apt install php libapache2-mod-php php-mysql php-cli -y
# Create a file at /var/www/html/info.php with below content
<?php phpinfo(); ?>
sudo apt install stress -y

- Next Steps:
- (CLI Approach)
- We need to deprovision the VM
- Create the VM Image for Linux
- Create a new VM with the VM image
- (Portal approach)
- Create a VM Image for Windows Server
