Azure - Provision

> Azure

1 - About

Code Shipping - Provisioning in Azure

Provisioning happens through VM extension.

2 - Example

2.1 - Linux

Create a VM with WordPress

# Open port 80 to allow web traffic to host.
az vm open-port --port 80 --resource-group myResourceGroup --name myVM
 
# Start a CustomScript extension to use a simple bash script to update, download and install WordPress and MySQL 
az vm extension set \
    --publisher Microsoft.Azure.Extensions \
    --version 2.0 \
    --name CustomScript \
    --vm-name myVM \
    --resource-group myResourceGroup \
    --settings '{"fileUris":["https://raw.githubusercontent.com/Azure/azure-quickstart-templates/master/wordpress-single-vm-ubuntu/install_wordpress.sh"],"commandToExecute":"sh install_wordpress.sh"}'
Advertising

2.2 - Windows

Quick Create a virtual machine with the Azure CLI

# Use CustomScript extension to install IIS.
az vm extension set \
  --publisher Microsoft.Compute \
  --version 1.8 \
  --name CustomScriptExtension \
  --vm-name myVM \
  --resource-group myResourceGroup \
  --settings '{"commandToExecute":"powershell.exe Install-WindowsFeature -Name Web-Server"}'