{"id":1001,"date":"2015-07-20T10:39:00","date_gmt":"2015-07-20T10:39:00","guid":{"rendered":"https:\/\/blogs.msdn.microsoft.com\/powershell\/2015\/07\/20\/introducing-azure-resource-manager-cmdlets-for-azure-powershell-dsc-extension\/"},"modified":"2024-02-22T08:11:24","modified_gmt":"2024-02-22T16:11:24","slug":"introducing-azure-resource-manager-cmdlets-for-azure-powershell-dsc-extension","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/powershell\/introducing-azure-resource-manager-cmdlets-for-azure-powershell-dsc-extension\/","title":{"rendered":"Introducing Azure Resource Manager cmdlets for Azure PowerShell DSC Extension"},"content":{"rendered":"<p><span style=\"font-family: Calibri Light; font-size: large;\">Last August we introduced <\/span><a href=\"http:\/\/blogs.msdn.com\/b\/powershell\/archive\/2014\/08\/07\/introducing-the-azure-powershell-dsc-desired-state-configuration-extension.aspx\"><span style=\"font-family: Calibri Light; font-size: large;\">Azure Service Management (ASM)<\/span><\/a><span style=\"font-family: Calibri Light; font-size: large;\"> cmdlets for PowerShell Desired State Configuration (DSC). Through these cmdlets released in the Azure PowerShell SDK, you can upload and apply a PowerShell DSC Configuration to an Azure VM. Now, we are introducing new set of cmdlets for deploying DSC Extension with Azure Resource Manager (<\/span><a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/resource-group-overview\/\"><span style=\"font-family: Calibri Light; font-size: large;\">ARM<\/span><\/a><span style=\"font-family: Calibri Light; font-size: large;\">). You can read more on using Azure PowerShell with ARM <\/span><a href=\"https:\/\/azure.microsoft.com\/en-us\/documentation\/articles\/powershell-azure-resource-manager\/\"><span style=\"font-family: Calibri Light; font-size: large;\">here<\/span><\/a><\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">If you already have the Azure PowerShell SDK installed, you will need to update to version <a href=\"http:\/\/azure.microsoft.com\/en-us\/downloads\/\">0.9.5<\/a><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><b><span style=\"font-family: calib; font-size: large;\">Key differences in ASM and ARM cmdlets<\/span><\/b><\/p>\n<ul>\n<li><span style=\"font-family: Calibri Light; font-size: large;\">In ARM, Resource group name, virtual machine name and storage account name are the new required parameters. <\/span><\/li>\n<li><span style=\"font-family: Calibri Light; font-size: large;\">ARM cmdlets are synchronous as opposed to ASM which are asynchronous.<\/span><\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">Let\u2019s look at each cmdlet and the syntax in detail below:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: medium;\"><span style=\"font-family: ca;\"><span style=\"color: #004080;\"><i>NAME<\/i><i><\/i><\/span><\/span><\/span><\/p>\n<p><i><span style=\"color: #004080; font-family: ca; font-size: medium;\">Publish-AzureVMDscConfiguration<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: medium;\"><span style=\"font-family: ca;\"><span style=\"color: #004080;\"><i>SYNOPSIS<\/i><i><\/i><\/span><\/span><\/span><\/p>\n<p><i><span style=\"color: #004080; font-family: ca; font-size: medium;\">Uploads a Desired State Configuration script to Azure blob storage, which later can be applied to Azure Virtual Machines using the Set-AzureVMDscExtension cmdlet.<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: medium;\"><span style=\"font-family: ca;\"><span style=\"color: #004080;\"><i>ASM SYNTAX<\/i><i><\/i><\/span><\/span><\/span><\/p>\n<p><i><span style=\"color: #004080; font-family: ca; font-size: medium;\">Publish-AzureVMDscConfiguration [-ConfigurationPath] &lt;String&gt; [-ContainerName &lt;String&gt;] [-Force [&lt;SwitchParameter&gt;]] [-StorageContext &lt;AzureStorageContext&gt;] [-StorageEndpointSuffix &lt;string&gt;] [-WhatIf [&lt;SwitchParameter&gt;]] [-Confirm [&lt;SwitchParameter&gt;]] [&lt;CommonParameters&gt;]<\/span><\/i><\/p>\n<p><span style=\"font-size: medium;\"><span style=\"font-family: ca;\"><span style=\"color: #004080;\"><i>Publish-AzureVMDscConfiguration<\/i><i> [-ConfigurationPath] &lt;String&gt; [-Force [&lt;SwitchParameter&gt;]] [-ConfigurationArchivePath &lt;String&gt;] [-WhatIf [&lt;SwitchParameter&gt;]] [-Confirm [&lt;SwitchParameter&gt;]] [&lt;CommonParameters&gt;]<\/i><\/span><\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: medium;\"><span style=\"font-family: ca;\"><span style=\"color: #004080;\"><i>ARM SYNTAX<\/i><i><\/i><\/span><\/span><\/span><\/p>\n<p><i><span style=\"color: #004080; font-family: ca; font-size: medium;\">Publish-AzureVMDscConfiguration [-ResourceGroupName] &lt;string&gt; [-ConfigurationPath] &lt;String&gt; [[-ContainerName] &lt;String&gt;] [-Force [&lt;SwitchParameter&gt;]] [-StorageAccountName] &lt;String&gt; [-StorageEndpointSuffix &lt;string&gt;] [-WhatIf [&lt;SwitchParameter&gt;]] [-Confirm [&lt;SwitchParameter&gt;]] [&lt;CommonParameters&gt;]<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p><i><span style=\"color: #004080; font-family: ca; font-size: medium;\">Publish-AzureVMDscConfiguration [-ConfigurationPath] &lt;String&gt; [-Force [&lt;SwitchParameter&gt;]] [[-OutputArchivePath] &lt;String&gt;] [-WhatIf [&lt;SwitchParameter&gt;]] [-Confirm [&lt;SwitchParameter&gt;]] [&lt;CommonParameters&gt;] <\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">As you can see from the ARM syntax above, ResourceGroupName (the name of the resource group that contains the storage account) and StorageAccountName (the Azure storage account name where the configuration would be uploaded) are required for uploading the configuration to the Azure storage. <\/span><\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">Let\u2019s take the IIS Install example from the previous <\/span><a href=\"http:\/\/blogs.msdn.com\/b\/powershell\/archive\/2014\/08\/07\/introducing-the-azure-powershell-dsc-desired-state-configuration-extension.aspx\"><span style=\"font-family: Calibri Light; font-size: large;\">blog.<\/span><\/a><\/p>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2015\/07\/7457.image_thumb_1B0BEE39.png\"><img decoding=\"async\" class=\"alignnone size-medium wp-image-20274\" src=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2015\/07\/7457.image_thumb_1B0BEE39-300x234.png\" alt=\"Image 7457 image thumb 1B0BEE39\" width=\"300\" height=\"234\" srcset=\"https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2015\/07\/7457.image_thumb_1B0BEE39-300x234.png 300w, https:\/\/devblogs.microsoft.com\/powershell\/wp-content\/uploads\/sites\/30\/2015\/07\/7457.image_thumb_1B0BEE39.png 361w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">To upload configuration IISInstall.ps1 to Azure storage using ARM, we need a resource group (<em>example-rg1<\/em>) with a storage account (<em>examplerg1stg<\/em>).<\/span><\/p>\n<p><span style=\"color: #004080; font-family: cali; font-size: medium;\"><em>Publish-AzureVMDscConfiguration -ResourceGroupName example-rg1 -ConfigurationPath &#8220;C:\\examples\\IISInstall.ps1&#8221; -StorageAccountName examplerg1stg <\/em><\/span><\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">Output:<\/span><\/p>\n<p><a href=\"https:\/\/examplerg1stg.blob.core.windows.net\/windows-powershell-dsc\/IISInstall.ps1.zip\"><span style=\"font-family: Calibri Light; font-size: large;\">https:\/\/examplerg1stg.blob.core.windows.net\/windows-powershell-dsc\/IISInstall.ps1.zip<\/span><\/a><\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">In the output above, https:\/\/examplerg1stg.blob.core.windows.net is the URL of the Azure blob, \u2018windows-powershell-dsc\u2019 is the default container and IISInstall.ps1.zip is the configuration archive created by the publishing cmdlet.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #004080; font-family: cali; font-size: medium;\"><em>NAME<\/em><\/span><\/p>\n<p><span style=\"color: #004080; font-family: cali; font-size: medium;\"><em>Set-AzureVMDSCExtension<\/em><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #004080; font-family: cali; font-size: medium;\"><em>SYNOPSIS<\/em><\/span><\/p>\n<p><span style=\"color: #004080; font-family: cali; font-size: medium;\"><em>Configure the Windows PowerShell Desired State Configuration extension on a VM.<\/em><\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"color: #004080; font-family: cali; font-size: medium;\"><em>ASM SYNTAX<\/em><\/span><\/p>\n<p><span style=\"color: #004080; font-family: cali; font-size: medium;\"><em>Set-AzureVMDscExtension [-ReferenceName\n&lt;String&gt;] [-ConfigurationArgument &lt;Hashtable&gt;] [-ConfigurationDataPath &lt;String&gt;] [-ConfigurationArchive] &lt;String&gt; [-ConfigurationName &lt;String&gt;] [-ContainerName &lt;String&gt;] [-Force [&lt;SwitchParameter&gt;]] [-StorageContext &lt;AzureStorageContext&gt;] [-Version &lt;String&gt;] [-StorageEndpointSuffix &lt;String&gt;] -VM &lt;IPersistentVM&gt; [-WhatIf [&lt;SwitchParameter&gt;]] [-Confirm [&lt;SwitchParameter&gt;]] [&lt;CommonParameters&gt;]<\/em><\/span><\/p>\n<p><span style=\"color: #004080; font-family: cali; font-size: medium;\"><em>ARM SYNTAX<\/em><\/span><\/p>\n<p><span style=\"color: #004080; font-family: cali; font-size: medium;\"><em>Set-AzureVMDSCExtension [-ArchiveBlobName] &lt;string&gt; [-ResourceGroupName] &lt;string&gt; [-VMName] &lt;string&gt; [-ArchiveStorageAccountName] &lt;string&gt; [-Version] &lt;string&gt; [-ConfigurationArgument &lt;hashtable&gt;] [-ConfigurationData &lt;string&gt;] [-ConfigurationName &lt;string&gt;] [-ArchiveResourceGroupName &lt;string&gt;] [-ArchiveContainerName &lt;string&gt;] [-Force] -Location &lt;string&gt; [-Name &lt;string&gt;] [-ArchiveStorageEndpointSuffix &lt;string&gt;] [-AutoUpdate] [-Confirm] [-WhatIf] [&lt;CommonParameters&gt;]<\/em><\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">In order to improve our user experience, we have changed the name of some parameters, and as a part of the ARM changes have added some new required parameters.<\/span><\/p>\n<ul>\n<li><span style=\"font-family: Calibri Light; font-size: large;\">ResourceGroupName, VMName, ArchiveStorageAccountName, Version, Location are all new required parameters.<\/span><\/li>\n<li><span style=\"font-family: Calibri Light; font-size: large;\">ArchiveResourceGroupName is a new optional parameter. You can specify this when your storage account belongs to a difference resource group than the one where the virtual machine is created. <\/span><\/li>\n<li><span style=\"font-family: Calibri Light; font-size: large;\">ConfigurationArchive is now called ArchiveBlobName<\/span><\/li>\n<li><span style=\"font-family: Calibri Light; font-size: large;\">ContainerName is now called ArchiveContainerName<\/span><\/li>\n<li><span style=\"font-family: Calibri Light; font-size: large;\">StorageEndpointSuffix is now called ArchiveStorageEndpointSuffix <\/span><\/li>\n<li><span style=\"font-family: Calibri Light; font-size: large;\">You can now use the \u2013AutoUpdate switch to enable automatic updating of the extension handler to the latest version as and when it is available. <\/span><\/li>\n<\/ul>\n<p><span style=\"font-size: large;\"><span style=\"font-family: Calibri Light;\">For more information on these parameters run <\/span><\/span><i><span style=\"color: #004080; font-family: Calibri; font-size: medium;\">Get-Help Set-AzureVMDscExtension \u2013Detailed<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">Now let\u2019s try to apply the configuration archive IISInstall.ps1.zip that we created using the Publish cmdlet to a virtual machine \u201cexample-rg1-vm1\u201d in the resource group \u201cexample-rg1\u201d<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: cali;\"><span style=\"font-size: medium;\"><span style=\"color: #004080;\"><i>Set-AzureVMDscExtension<\/i><i> -ResourceGroupName <span style=\"font-family: ca;\">example<\/span>-rg1 -VMName example-rg1-vm1 -ArchiveBlobName IISInstall.ps1.zip -ArchiveStorageAccountName examplerg1stg -ConfigurationName IISInstall -Version 2.0 -Location &#8216;West US&#8217; <\/i><\/span><\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">Note that we are using the latest DSC Extension version 2.0 and have not specified the \u2013AutoUpdate flag. This will ensure that the extension version is pinned to 2.0 unless it\u2019s updated. Also, note that we are not using Update-AzureVM to update the VM as the Set-AzureVMDscExtension cmdlet for ARM is synchronous. On the flip side, it takes longer for the Set-AzureVMDscExtension cmdlet to finish the update operation. However, you can view the status of the extension using the Get-AzureVM cmdlet as described below:<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0in 10pt; line-height: normal;\"><span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">PS C:\\&gt; $status = Get-AzureVM -ResourceGroupName example-rg1 -Name example-rg1  <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">-vm1 -Status -Verbose                                                           <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">PS C:\\&gt; $status.Extensions.Statuses                                             <\/span>\r\n                                                                                \r\n                                                                                \r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Code          : ProvisioningState\/transitioning                                 <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">DisplayStatus : Transitioning                                                   <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Level         : Info                                                            <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Message       : DSC configuration is in progress.                               <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Time          :                                                                 <\/span>\r\n                                                                                \r\n                                                                                \r\n                                                                                \r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">PS C:\\&gt; $status.Extensions.SubStatuses                                          <\/span>\r\n                                                                                \r\n                                                                                \r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Code          : ComponentStatus\/DscConfigurationLog\/transitioning               <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">DisplayStatus : Transitioning                                                   <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Level         : Info                                                            <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Message       : Perform operation 'Invoke CimMethod' with following             <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                parameters, ''methodName' = SendConfigurationApply,'className'  <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                = MSFT_DSCLocalConfigurationManager,'namespaceName' =           <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">\r\n     root\/Microsoft\/Windows\/DesiredStateConfiguration'.              <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Time          :                                                                 <\/span>\r\n<\/pre>\n<pre style=\"margin: 0in 10pt; line-height: normal;\"><span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">PS C:\\&gt; $status = Get-AzureVM -ResourceGroupName example-rg1 -Name example-rg1  <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">-vm1 -Status -Verbose                                                           <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">PS C:\\&gt; $status.Extensions.Statuses                                             <\/span>\r\n                                                                                \r\n                                                                                \r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Code          : ProvisioningState\/succeeded                                     <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">DisplayStatus : Provisioning succeeded                                          <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Level         : Info                                                            <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Message       : DSC configuration was applied successfully.                     <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Time          :                                                                 <\/span>\r\n                                                                                \r\n                                                                                \r\n                                                                                \r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">PS C:\\&gt; $status.Extensions.SubStatuses                                          <\/span>\r\n                                                                                \r\n                                                                                \r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Code          : ComponentStatus\/DscConfigurationLog\/succeeded                   <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">DisplayStatus : Provisioning succeeded                                          <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Level         : Info                                                            <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Message       : Perform operation 'Invoke CimMethod' with following             <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                parameters, ''methodName' = SendConfigurationApply,'className'  <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                = MSFT_DSCLocalConfigurationManager,'namespaceName' =           <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                root\/Microsoft\/Windows\/DesiredStateConfiguration'.              <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                An LCM method call arrived from computer EXAMPLE-RG1-VM1 with   <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                user sid S-1-5-18.                                              <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                The -Force option was specified with the Stop operation. The    <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                current configuration has been successfully cancelled.          <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                An LCM method call arrived from computer EXAMPLE-RG1-VM1 with   <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                user sid S-1-5-18.                                              <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [EXAMPLE-RG1-VM1]: LCM:  [ Start  Set      ]                    <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [EXAMPLE-RG1-VM1]: LCM:  [ Start  Resource ]                    <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [[WindowsFeature]IIS]                                           <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [EXAMPLE-RG1-VM1]: LCM:  [ Start  Test     ]                    <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [[WindowsFeature]IIS]                                           <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [EXAMPLE-RG1-VM1]:                                              <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [[WindowsFeature]IIS] The operation 'Get-WindowsFeature'        <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                started: Web-Server                                             <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [EXAMPLE-RG1-VM1]:                                              <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [[WindowsFeature]IIS] The operation 'Get-WindowsFeature'        <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                succeeded: Web-Server                                           <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [EXAMPLE-RG1-VM1]: LCM:  [ End    Test     ]                    <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [[WindowsFeature]IIS]  in 16.3710 seconds.                      <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [EXAMPLE-RG1-VM1]: LCM:  [ Skip   Set      ]                    <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [[WindowsFeature]IIS]                                           <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [EXAMPLE-RG1-VM1]: LCM:  [ End    Resource ]                    <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [[WindowsFeature]IIS]                                           <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [EXAMPLE-RG1-VM1]: LCM:  [ End    Set      ]                    <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                [EXAMPLE-RG1-VM1]: LCM:  [ End    Set      ]    in  23.8520\r\n  <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                seconds.                                                        <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                Operation 'Invoke CimMethod' complete.                          <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                Time taken for configuration job to complete is 34.903 seconds  <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Time          :                                                                 <\/span>\r\n                                                                                \r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">**We are working on improving this experience of retrieving the configuration status. Stay tuned for more updates.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">Output of the Set-AzureVMDscExtension cmdlet post configuration update. <\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0in 10pt; line-height: normal;\"><span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">PS C:\\&gt; Set-AzureVMDscExtension -ResourceGroupName example-rg1 -VMName example-r<\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">g1-vm1 -ArchiveBlobName IISInstall.ps1.zip -ArchiveStorageAccountName examplerg1<\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">stg -ConfigurationName IISInstall -Version 2.0 -Location 'West US'              <\/span>\r\n                                                                                \r\n                                                                                \r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Status              : Succeeded                                                 <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Output              :                                                           <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Error               :                                                           <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">StartTime           : 7\/20\/2015 12:41:05 PM -07:00                              <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">EndTime             : 7\/20\/2015 12:45:05 PM -07:00                              <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">TrackingOperationId : 9bed9a33-da40-4933-941f-b7acbc1e38ba                      <\/span>\r\n                                                                                \r\n<\/pre>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">Example: Use of Set cmdlet with arguments to the configuration function and -Autoupdate switch<\/span><\/p>\n<p><i><span style=\"color: #004080; font-family: cali; font-size: medium;\">Set-AzureVMDscExtension<\/span><\/i><i><span style=\"color: #004080; font-family: cali; font-size: medium;\"> -ResourceGroupName example-rg1 -VMName example-rg1-vm1 -ArchiveBlobName IISSample.ps1.zip -ArchiveStorageAccountName examplerg1stg -ConfigurationName IISInstall -ConfigurationArgument @{arg=&#8221;val&#8221;} -ArchiveContainerName \u201cYour_Container_Name\u201d -ConfigurationData SampleData.psd1 -Version 1.10 -Location &#8216;West US&#8217; \u2013AutoUpdate<\/span> <\/i><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">You can also use ARM templates to install the extension and use Set-AzureVMDscExtension cmdlet to apply configurations to the same VM. Note that the name of the extension provided in the \u2013Name parameter of the cmdlet should match to that in the template. By default, value of the \u2013Name parameter is \u2018Microsoft.Powershell.DSC\u2019. Also, name of the extension is case sensitive.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">Use <em>Get-AzureVMDscExtension<\/em> to see the DSC Extension status of the configuration applied.<\/span><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: medium;\"><span style=\"font-family: cali;\"><span style=\"color: #004080;\"><i>NAME<\/i><i><\/i><\/span><\/span><\/span><\/p>\n<p><i><span style=\"color: #004080; font-family: cali; font-size: medium;\">Get-AzureVMDscExtension<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: medium;\"><span style=\"font-family: cali;\"><span style=\"color: #004080;\"><i>SYNOPSIS<\/i><i><\/i><\/span><\/span><\/span><\/p>\n<p><i><span style=\"color: #004080; font-family: cali; font-size: medium;\">Gets the settings of the DSC extension on a particular VM<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><i><span style=\"color: #004080; font-family: cali; font-size: medium;\">ASM SYNTAX<\/span><\/i><\/p>\n<p><span style=\"font-size: medium;\"><span style=\"font-family: cali;\"><span style=\"color: #004080;\"><i>Get-AzureVMDscExtension<\/i><i> [-VM] &lt;IPersistentVM&gt; [[-Version] &lt;string&gt;] [&lt;CommonParameters&gt;] <\/i><\/span><\/span><\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: medium;\"><span style=\"font-family: cali;\"><span style=\"color: #004080;\"><i>ARM SYNTAX<\/i><i><\/i><\/span><\/span><\/span><\/p>\n<p><i><span style=\"color: #004080; font-family: cali; font-size: medium;\">Get-AzureVMDscExtension [-ResourceGroupName] &lt;string&gt; [-VMName] &lt;string&gt; [[-Name] &lt;String&gt;] [-Status] [&lt;CommonParameters&gt;]<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">Example: As you can see from the output of this cmdlet below, the IISInstall.ps1 was applied successfully to the virtual machine example-rg1-vm1 in the resource group \u201cexample-rg1\u201d<\/span><\/p>\n<p>&nbsp;<\/p>\n<pre style=\"margin: 0in 10pt; line-height: normal;\"><span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">PS C:\\&gt; Get-AzureVMDscExtension -ResourceGroupName example-rg1 -VMName example-r<\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">g1-vm1 -Status                                                                  <\/span>\r\n                                                                                \r\n                                                                                \r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">ResourceGroupName     : example-rg1                                             <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Name                  : Microsoft.Powershell.DSC                                <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Publisher             : Microsoft.Powershell                                    <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">ExtensionType         : DSC                                                     <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">TypeHandlerVersion    : 2.0                                                     <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">ProvisioningState     : Succeeded                                               <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Location              : westus                                                  <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Id                    : \/subscriptions\/4c85cb83-4cad-46cd-a771-ff9d1c079de2\/res <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                        ourceGroups\/example-rg1\/providers\/Microsoft.Compute\/virt<\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                       ualMachines\/example-rg1-vm1\/extensions\/Microsoft.Powershe<\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                       ll.DSC                                                   <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">ModulesUrl            : https:\/\/examplesrg1stg.blob.core.windows.net\/windows-pow<\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                        ershell-dsc\/IISInstall.ps1.zip                          <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">ConfigurationFunction : IISInstall.ps1\\IISInstall                               <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Properties            : {}                                                      <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Statuses              : [                                                       <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                          {                                                     <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                            \"Code\": \"ProvisioningState\/succeeded\",              <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                            \"DisplayStatus\": \"Provisioning succeeded\",          <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                            \"Level\": \"Info\",                                    <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                            \"Message\": \"DSC configuration was applied           <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                        successfully.\",                                         <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                            \"Time\": null                                        <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                          }                                                     <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">                        ]                                                       <\/span>\r\n                                                                                \r\n<\/pre>\n<p><span style=\"font-size: medium;\"><span style=\"font-family: cali;\"><span style=\"color: #004080;\"><i>NAME<\/i><i><\/i><\/span><\/span><\/span><\/p>\n<p><i><span style=\"color: #004080; font-family: cali; font-size: medium;\">Remove-AzureVMDscExtension<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: medium;\"><span style=\"font-family: cali;\"><span style=\"color: #004080;\"><i>SYNOPSIS<\/i><i><\/i><\/span><\/span><\/span><\/p>\n<p><i><span style=\"color: #004080; font-family: cali; font-size: medium;\">Removes DSC extension handler from a given virtual machine(s) in a cloud service. Output of this cmdlet needs to be piped to Update-AzureVM cmdlet. To get detailed output -Verbose flag need to be specified.<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: medium;\"><span style=\"font-family: cali;\"><span style=\"color: #004080;\"><i>ASM SYNTAX<\/i><i><\/i><\/span><\/span><\/span><\/p>\n<p><i><span style=\"color: #004080; font-family: cali; font-size: medium;\">Remove-AzureVMDscExtension -VM &lt;IPersistentVM&gt; [&lt;CommonParameters&gt;] <\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: medium;\"><span style=\"font-family: cali;\"><span style=\"color: #004080;\"><i>NAME<\/i><i><\/i><\/span><\/span><\/span><\/p>\n<p><i><span style=\"color: #004080; font-family: cali; font-size: medium;\">Remove-AzureVMDscExtension<\/span><\/i><\/p>\n<p><span style=\"font-size: medium;\"><span style=\"font-family: cali;\"><span style=\"color: #004080;\"><i>SYNOPSIS<\/i><i><\/i><\/span><\/span><\/span><\/p>\n<p><i><span style=\"color: #004080; font-family: cali; font-size: medium;\">Removes DSC extension handler from a VM in a resource group<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: medium;\"><span style=\"font-family: cali;\"><span style=\"color: #004080;\"><i>ARM SYNTAX<\/i><i><\/i><\/span><\/span><\/span><\/p>\n<p><i><span style=\"color: #004080; font-family: cali; font-size: medium;\">Remove-AzureVMDscExtension [-ResourceGroupName] &lt;String&gt; [-VMName] &lt;String&gt; [[-Name] &lt;String&gt;] [&lt;CommonParameters&gt;]<\/span><\/i><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">Example:<\/span><\/p>\n<pre style=\"margin: 0in 10pt; line-height: normal;\"><span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">PS C:\\&gt; Remove-AzureVMDscExtension -ResourceGroupName example-rg1 -VMName exampl<\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">e-rg1-vm1 -Name 'Microsoft.Powershell.DSC'                                      <\/span>\r\n                                                                                \r\n                                                                                \r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Status              : Succeeded                                                 <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Output              :                                                           <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">Error               :                                                           <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">StartTime           : 1\/1\/0001 12:00:00 AM +00:00                               <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">EndTime             :                                                           <\/span>\r\n<span style=\"font-family: courier new; background: #012456; color: #eeedf0;\">TrackingOperationId :                                                           <\/span>\r\n                                                                                \r\n<\/pre>\n<p>&nbsp;<\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">Note that unlike ASM the Remove operation in ARM is synchronous as well. <\/span><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><b><span style=\"font-family: cali; font-size: large;\">Upcoming Changes:<\/span><\/b><\/p>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">The functionalities we are considering working on for the next release of Azure PowerShell SDK release are the following: <\/span><\/p>\n<ul>\n<li><span style=\"font-family: Calibri Light; font-size: large;\">A switch parameter to skip packing of dependent modules in the zip file.<\/span><\/li>\n<li><span style=\"font-family: Calibri Light; font-size: large;\">Allow adding configuration data in the zip file.<\/span><\/li>\n<li><span style=\"font-family: Calibri Light; font-size: large;\">Allow adding other additional content in the zip file.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-family: Calibri Light; font-size: large;\">Let us know what you think in the comments below!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Last August we introduced Azure Service Management (ASM) cmdlets for PowerShell Desired State Configuration (DSC). Through these cmdlets released in the Azure PowerShell SDK, you can upload and apply a PowerShell DSC Configuration to an Azure VM. Now, we are introducing new set of cmdlets for deploying DSC Extension with Azure Resource Manager (ARM). You [&hellip;]<\/p>\n","protected":false},"author":600,"featured_media":13641,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1001","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-powershell"],"acf":[],"blog_post_summary":"<p>Last August we introduced Azure Service Management (ASM) cmdlets for PowerShell Desired State Configuration (DSC). Through these cmdlets released in the Azure PowerShell SDK, you can upload and apply a PowerShell DSC Configuration to an Azure VM. Now, we are introducing new set of cmdlets for deploying DSC Extension with Azure Resource Manager (ARM). You [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/1001","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/users\/600"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/comments?post=1001"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/posts\/1001\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media\/13641"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/media?parent=1001"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/categories?post=1001"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/powershell\/wp-json\/wp\/v2\/tags?post=1001"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}