Sunday, August 9, 2020

 Install IIS on Azure Virtual machines using Azure PowerShell


1.Open the interactive shell and make sure that it's set to PowerShell.

Click on cloud shell icon appears next to global search as depicted in image below:

CloudShell

2.Run the following command to install IIS on the virtual machine:

Azure PowerShellCopy

*****************************************************

 $publicSettings = @{ "fileUris" = (,"https://raw.githubusercontent.com/Azure/azure-docs-powershell-samples/master/application-gateway/iis/appgatewayurl.ps1");  "commandToExecute" = "powershell -ExecutionPolicy Unrestricted -File appgatewayurl.ps1" }


    Set-AzVMExtension `

     -ResourceGroupName vm2_group`

     -Location eastus `

     -ExtensionName IIS `

     -VMName VM2 `

     -Publisher Microsoft.Compute `

     -ExtensionType CustomScriptExtension `

     -TypeHandlerVersion 1.4 `

     -Settings $publicSettings

*****************************************************

Kindly refer an image below for reference.



1.Ensure that provide resource Group name and virtual machines names Create two more virtual machines and install IIS using the steps. 


Once success message appears on the screen , Logged in to virtual machines and verify .


I hope it will help you who has started exploring Azure and would like to enable IIS feature in easiest manner.




0 comments :

Post a Comment