Deploying IIS app to VM Scale Set

Eric Hodges 41 Reputation points

I am planning on using an App Gateway with a Virtual Scale Set to host an custom-built IIS website. I need a way to get the code onto the servers, configure server settings, etc. on the VMs in the scale set each time the website is deployed. The deployments will be kicked off in Azure DevOps (though that could simply call something else, e.g. an Azure Automation runbook). The artifacts could be stored anywhere; maybe in an Azure blob storage account. I am trying to figure the best way to do this.

  1. I found a blog post about baking the apps into your scale set VM images. I will install IIS and other prerequisites in the image used to deploy the VMs in the VMSS. But the app itself will be updated regularly. Re-imaging is super-slow, and much less efficient than just pushing out new binaries.
  2. Another option would be to use the Custom Script Extension. When changing versions of the code, I could change the script extension and rely on VMSS auto-update to run the new script extension on all the instances in the VMSS. Basically what is outlined here. All the VMs will need to access the storage, and the scripts would be running 100% locally.
  3. A third option (my personal preference if possible) would be to kick off a central script (e.g. in Azure Automation) that would copy the files and perform whatever steps are necessary to get the new version running on each node. Ideally I would even drain each node in the App Gateway before updating it. I could use commands like Invoke-AzVmssVMRunCommand to run commands on the VMs in the Scale Set. (I've had a hard time figuring out how to copy the new files to the computer, which seems like it should have been easy.) This script could also be triggered on scale-out when a new VM is added to the Scale Set.

Are there other options I should consider? Any comments on the three above?


Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
230 questions
No comments
{count} votes

Accepted answer
  1. srbhatta-MSFT 8,446 Reputation points Microsoft Employee

    Hello @Eric Hodges ,
    Thanks for reaching out to Microsoft QnA.
    Yes, according to my opinion, the second option to deploy application to VMSS using custom script extension looks good to me as it is mentioned in detail in the document.
    I am not fully aware of how you should copy the new files to the computer in regards to the third option you have mentioned-doing everything via Azure Automation. I will have to internally check on this.

    Please feel free to reach back by replying to my answer and tagging me.


    Please don't forget to Accept as Answer and Upvote and if you think my response was helpful.

0 additional answers

Sort by: Most helpful