Remove-AzureVMDscExtension, doesn't seem to work

This topic contains 3 replies, has 2 voices, and was last updated by Profile photo of Tudor A. Lascu Tudor A. Lascu 1 year, 8 months ago.

  • Author
    Posts
  • #22453
    Profile photo of Tudor A. Lascu
    Tudor A. Lascu
    Participant

    Hi everybody,
    I'm starting to explore the Azure DSC connection.
    I was able to successfully deploy a configuration through

     Publish-AzureVMDscConfiguration -StorageContext $storageContext -ConfigurationPath '.\basic-iis-configuration.ps1'

    and

     $vm = Set-AzureVMDSCExtension -VM $vm -StorageContext $storageContext -ConfigurationArchive "basic-iis-configuration.ps1.zip" -ConfigurationName "IISInstall"

    But in the cleanup phase, when I try to remove the DSC extension from the VM through

     Remove-AzureVMDscExtension -VM $vm -Verbose | Update-AzureVM

    nothing seems to happen.
    Did anyone else encounter the same problem? Any hints?

    Thanks a lot!

  • #22548
    Profile photo of Don Jones
    Don Jones
    Keymaster

    I'm not sure you're meant to pipe that to Update-AzureVM. What happens when you try running just the Remove- command? Does it DO anything, regardless of whether or not it prints anything on the screen?

  • #22656
    Profile photo of Tudor A. Lascu
    Tudor A. Lascu
    Participant

    Hi,
    I actually saw the command piped to Update-AzureVM in this article: [url]{http://www.powershellmagazine.com/2014/08/05/understanding-azure-vm-dsc-extension/}[/url]
    When I run

    {Remove-AzureVMDscExtension -VM $vm -Verbose}

    it prints the following

    DeploymentName : my-first-vm
    Name : my-first-vm
    Label :
    VM : Microsoft.WindowsAzure.Commands.ServiceManagement.Model.PersistentVM
    InstanceStatus : ReadyRole
    IpAddress : 100.91.86.111
    InstanceStateDetails :
    PowerState : Started
    InstanceErrorCode :
    InstanceFaultDomain : 0
    InstanceName : my-first-vm
    InstanceUpgradeDomain : 0
    InstanceSize : Small
    HostName : my-first-vm
    AvailabilitySetName :
    DNSName : http://first-ale-vm.cloudapp.net/
    Status : ReadyRole
    GuestAgentStatus : Microsoft.WindowsAzure.Commands.ServiceManagement.Model.GuestAgentStatus
    ResourceExtensionStatusList : {Microsoft.Compute.BGInfo, Microsoft.Powershell.DSC}
    PublicIPAddress :
    PublicIPName :
    NetworkInterfaces : {}
    ServiceName : first-ale-vm
    OperationDescription : Get-AzureVM
    OperationId : b46f15a8a0cc7a9fb7578e7a1a8aec72
    OperationStatus : OK

    and nothing seems to happen as I checked by looking both at the graphical interface through portal.azure.com and by printing $vm.ResourceExtensionStatusList, obtaining:
    ...
    HandlerName : Microsoft.Powershell.DSC
    Version : 1.5.0.0
    Status : Ready
    Code :
    Message :
    FormattedMessage :
    ExtensionSettingStatus : Microsoft.WindowsAzure.Commands.ServiceManagement.Model.ResourceExtensionConfigurationStatus
    ExtensionData :

    Thanks a lot for your help!

  • #23632
    Profile photo of Tudor A. Lascu
    Tudor A. Lascu
    Participant

    Hi,
    for anyone interested I forward the answer I received from Microsoft Connect in response to [url]https://connect.microsoft.com/PowerShell/feedback/details/1162331/remove-azurevmdscextension-does-not-seem-to-work[/url].
    Apparently the one above is a well known issue for all [b]Remove-AzureVM*Extension[/b] cmdlets. This has also been filed under [url]https://github.com/Azure/azure-powershell/issues/257[/url].
    As a fix, in the mean time, one can use the [b]Set-AzureVMExtension[/b] cmdlet with option [b]-Uninstall[/b] as in:

    $vm | Set-AzureVMExtension -Uninstall -ExtensionName DSC -Publisher Microsoft.Powershell -Version 1.* | Update-AzureVM

    Cheers!

You must be logged in to reply to this topic.