Azure – Certification 70-532-Part 10 – Configure Azure PowerShell Desired State Configuration (DSC) Through Azure Portal

Hello Friends,
If you missed our following articles on Exam 70-532: Developing Microsoft Azure Solutions, Please have a look once here :

Azure – Certification 70-532-Part 6 – Create a Virtual Machine with Azure Power Shell

Azure – Certification 70-532-Part 7 – Deploying a Web App to Azure Virtual Machine with Web Deploy method

Azure – Certification 70-532-Part 8 – Remote debugging on an Azure VM

Azure – Certification 70-532-Part 9 – Azure Automation State Configuration

Azure – Certification 70-532-Part 11 – Configure Azure PowerShell Desired State Configuration (DSC) Using PoserShell

Today we will continue with our last blog Concept of Azure Automation State Configuration. As we know, it is possible to configure Azure Automation State Configuration and Azure Powershell Desired State Configuration (DSC) in two different approaches. One is using powershell, which we will cover in our next blog and the other one is through Azure Portal.Today in this blog we will configure Azure powershell DSC using Azure Portal.

Prerequisites :
An Azure Resource Manager VM (not Classic) running Windows Server 2008 R2 or later. For this example we have created one VM “DSCServer” in advance. As we can see in the following figure, we have verified that, currently IIS not installed/available with this VM. Our Azure powershell DSC, will install/configure the IIS on this server/Node for us.

IIS not installed
Figure 1: Azure Certification 70-532 – IIS not available on this VM

Configuration :

Now we are ready to start with our first Azure DSC configuration. We will go step by step in little detail with real time figures.

  1. Connect to your Azure portal dashboard using your subscription account. If you don’t have any subscription, in that case you can get trial Azure subscription with one-month of validity. Then you can connect to the azure portal dashboard as in following figure.

    Azure portal dashboard
    Figure 1: Azure Certification 70-532 – portal dashboard

  2. To proceed with our configuration, first we need an Azure Automation account. So let’s create an Azure Automation Run As account. In the Azure portal, click All services. In the list of resources, type Automation. As we begin typing, the list filters based on our input. Select Automation Accounts, as shown in following figure, we need to .

    Create Automation Account
    Figure 2: Azure Certification 70-532 – Create Automation Account

  3. On the Automation Accounts page, Click + Add button to create a Automation Account. Provide all required information and don’t forgot to set Yes to Create Azure Run As Account and click Create button to create the new account. While Azure creates the Run As account, we can track the progress under Notifications from the menu, as shown in following figure.

    Automation Account
    Figure 3: Azure Certification 70-532 – Automation Account

  4. Now we are ready with our Automation Account. The next step is to create a simple DSC configuration that ensures the presence of the Web-Server Windows Feature (IIS). When we create a DSC configuration, 3 major component comes into the picture. Those are Configuration, Node and Resource. All these need to be declare in the powershell script, as shown in the following figure .

    DSC Configuration
    Figure 4: Azure Certification 70-532 – DSC Configuration

  5. Once we are ready with our Azure DSC configuration file(ManasTestConfig.ps1), Let’s Import the configuration into Azure Automation.To Import the configuration, Click on newly created Automation Account and on Automation Account page,select State configuration (DSC) under Configuration Management, as shown in following figure.

    Inside Automation Account
    Figure 5: Azure Certification 70-532 – Inside Automation Account

  6. Once we are ready with our Azure DSC configuration file, Let’s Import the configuration into Azure Automation.To Import the configuration, Click on newly created Automation Account and on Automation Account page,select State configuration (DSC) under Configuration Management, as shown in following figure.

    Configuration List Of Automatic Account
    Figure 6: Azure Certification 70-532 – Configuration List Of Automatic Account

  7. As shown in above figure, on the State configuration (DSC) page, click the Configurations tab, then click + Add. This will open Import Configuration page.

  8. On Import Configuration page, browse to our DSC configuration file ManasTestConfig.ps1 on our computer. Provide other required information before importing the DSC configuration file and click Ok to start importing.

    Importing Azure DSC Configurationunt
    Figure 7: Azure Certification 70-532 – Importing Azure DSC Configuration

  9. After importing the DSC configuration, we can view the configuration, as shown in the following figure.

     Post Importing the configuration doc
    Figure 8: Azure Certification 70-532 – Post Importing the configuration doc

  10. Now time comes to Compiling our DSC configuration in Azure Automation. On the State configuration (DSC) page, click the Configurations tab, then click ManasTestConfig (the name of the previously imported configuration).
    On the ManasTestConfig Configuration page, click Compile, and then click Yes. This starts a compilation job, as shown in the following figure.

    Before Compilation of configuration
    Figure 9: Azure Certification 70-532 – Before Compilation of configuration

    After Compilation of configuration
    Figure 10: Azure Certification 70-532 – After Compilation of configuration

  11. On boarding an Azure VM for management with Azure Automation State Configuration. Here we need a VM (not Classic) running Windows Server 2008 R2 or later. As shown in the following figure, move to State configuration (DSC) page. On the State configuration (DSC) page, while on the Nodes tab, click + Add.

    Add new node to DSC Configuration
    Figure 11: Azure Certification 70-532 – Add new node to DSC Configuration

  12. When we click +Add button to adding a Node, it will open Virtual Machines page. On the Virtual Machines page, select our VM and on the Virtual machine detail page, click + Connect to open the Registration section page as shown in the following figure.

    On boarding Nodes (VM)
    Figure 12: Azure Certification 70-532 – On boarding Nodes (VM)

  13. As shown in the above figure,In the Registration page, select the name of the node configuration we want to apply to the VM in the Node configuration name box. Providing a name at this point is optional. we can change the assigned node configuration after onboarding the node. Check Reboot Node if Needed, then let’s click OK. The node configuration we specified are applied to the VM at intervals specified by the Configuration Mode Frequency, and the VM checks for updates to the node configuration at intervals specified by the Refresh Frequency.In the Add Azure VMs blade, click Create.
  14. Azure starts the process of onboarding the VM. When it is complete, the VM shows up in the Nodes tab of the State configuration (DSC) page in the Automation account., as shown in the following figure

    Node onboarded
    Figure 13: Azure Certification 70-532 – Node onboarded

    Configuration Report
    Figure 14: Azure Certification 70-532 – Configuration Reportd

  15. After DSC configuration executed for the first time, we verified that, the IIS has been installed successfully on the Node (VM) we have added, as shown in the following figure

    IIS installed post DSC run
    Figure 15: Azure Certification 70-532 – IIS installed post DSC run

  16. Addition to the above, we can achieve the followings.

    • Viewing reports for managed nodes, as shown in above figure 14.
    • Reassigning a node to a different node configuration
    • Unregistering a node

Hope this blog gives you some information about Azure Automation State Configuration.

Thanks for reading 🙂

Keep reading, share your thoughts, experiences. Feel free to contact us to discuss more. If you have any suggestion / feedback / doubt, you are most welcome.

Stay tuned on Knowledge-Junction, will come up with more such articles.

Advertisements

Comments

8 comments on “Azure – Certification 70-532-Part 10 – Configure Azure PowerShell Desired State Configuration (DSC) Through Azure Portal”
  1. Manoj Sutar says:

    good

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.