Azure & Desired State Configuration Part 1/4


I recently had a customer that requested some demo's on how they could use Azure Automation, Azure and PowerShell to Automate their deployments and increase the quality of deployments. In this 4 Part Series I will be going through the different options you have for deploying and understanding that it is not some scary, vague concept that only developers can use. If you work in Operations(or any other area working with VMs and Operating Systems), this might be of great benefit ensuring consistent and repetitive deployments of what would have been admin intensive tasks previously. 

Part 1 : Deploy a Web Server on a new VM using Desired State Configuration in the Azure Portal

What will I need? 


– Azure Subscription (with Permissions to create resources)


  1. >Create the PowerShell (.ps1) file that will be doing the Web Server Role Installation. If you would like to learn more about the structure of aDSC ScriptseeDSC Configurations – PowerShell | Microsoft Docs 


  1. >Compile the PowerShell file using the command shown below, your file will be saved as a “.zip” file. Compilation validates the configuration and allows for the input of parameter values. To learn more about compiling a configuration,seeCompile DSC configurations in Azure Automation State Configuration | Microsoft Docs>. 


  1. Upload this compressed “.zip” file to an Azure Account


  1. Create a new Virtual Machine in the Azure Portal but stop at the Advanced Tab


  1. Click on Select an extension to install


  1. Scroll down and select PowerShell Desired State Configuration


  1. After following the prompts browse to your account and select your “.zip” file. Notice the “Module-qualified Name of Configuration” matches up with the module name we used in the PowerShell Script. Think of it as “ScriptName.ps1ModuleName”


  1. Complete the Creation


  1. Look at the Deployment and you will see the DSC extension running after creation


  1. Once the deployment is complete you can browse to Extensions in the Blade


  1. When logging in to the server you will see that IIS has been installed with all defaults




We just explored how easy it is to deploy a Web Server using our own Desired State Configuration file and the functionality of the Azure portal. There are many more items that can be installed, configured, and even repaired/auto corrected using Desired State Configuration. Some examples can be found: 

Official Documentation DSC Configurations – PowerShell | Microsoft Docs 

GitHub PowerShell/DscResources: Central repository for PowerShell Desired State Configuration (DSC) resources. ( 

PowerShell Gallery PowerShell Gallery | Packages: 


This article was originally published by Microsoft's Azure Blog. You can find the original article here.