The Azure PowerShell Desired State Configuration (DSC) Extension team has announced a new cmdlet that makes it easy to retrieve DSC configuration status from the Azure Virtual Machine. This cmdlet is one of the many enhancements from the PowerShell DSC team to provide an easy to use mechanism for applying DSC configuration to Azure VMs. Here is the full list of features DSC Extension enhancements.
If you are new to the DSC Extension, please refer to the blog post here. In a nutshell, the Azure DSC Extension, allows you to upload and apply DSC configuration on a remote VM using PowerShell or Azure Portal enabling you to leverage the power of DSC in Azure without requiring you to configure any extra ports on the VM. As with any other VM Extension, it can be added to the VM anytime during its lifecycle.
If you are new to DSC or are already using DSC on-premises and would like to extend it to Azure, here is the typical workflow:
1. Select the DSC Resource: Use built-in DSC resource or write custom resources to perform configuration actions on the VM.
2. Publish the Resource: Publish the DSC resource to Azure Storage using the Publish- AzureVMDscConfiguration cmdlet.
3. Apply DSC Configuration to the VM: Apply the DSC configuration to the virtual machine either from PowerShell (Set-AzureVMDscExtension) or Azure Portal.
4. Monitor Status: Monitor the DSC configuration status.
Detailed steps for all of the above can be found in the MSDN Documentation Page.
Here is how the new cmdlet, Get-AzureVMDscExtensionretrieves the DSC configuration status from the VM.
PS C:\dsc-azure-ext\tests\EndToEnd> $status = Get-AzureVMDscExtensionStatus -ServiceName example-0 -Name example-0 PS C:\dsc-azure-ext\tests\EndToEnd> $status ServiceName : example-0 Name : example-0 Status : Transitioning StatusCode : 9 Timestamp : 2/26/2015 4:50:10 AM StatusMessage : DSC configuration is in progress. DscConfigurationLog : {Perform operation 'Invoke CimMethod' with following parameters, ''methodName' = SendConfigurationApply,'className' = MSFT_DSCLocalConfigurationManager,'namespaceName' = root/Microsoft/Windows/DesiredStateConfiguration'., An LCM method call arrived from computer EXAMPLE-0 with user sid S-1-5-18., An LCM method call arrived from computer EXAMPLE-0 with user sid S-1-5-18., [EXAMPLE-0]: LCM: [ Start Set ]...}
We hope you find this new addition helpful! Please send us feedback on what feature enhancements you would like to see to make it easy to run PowerShell DSC on Azure.