How To Deploy An Application To An Azure Virtual Machine (VM) Using The Custom Script Extension

When building VM’s in Azure, automating application and server role deployment is a key activity, it is indeed one of the many reasons why you would use Azure. There are many solutions you can use to complete these tasks within Azure, Nick will show you a simple method to take your first steps in automation, using Azure’s Custom Script extension. This extension is useful for post-deployment configuration, software installation, or any other configuration/management task. Scripts can be downloaded from Azure storage or GitHub, or provided to the Azure portal at extension runtime. We will use Set-AzureRmVMexternsion to install IIS (Internet Information Server), then modify the default html file to display the name of your VM. Once completed we can retrieve the public ip of your IIS server using Get-AzureRmPublicIPAddress and test that the script extension executed correctly.

Prerequisites include: Azure account AzureRm PowerShell module Windows VM running in Azure Firewall open on port 80