Azure / Azure/azure-powershell

[Eng]: Remove-AzVMExtension doesn't perform proper uninstall of the HybridWorkerExtension on the Guest OS

Open
#23,605 5 comments 0 reactions 1 assignee Assigned to @n-bajaj View on GitHub
act-codegen-extensibility-squad bug Compute - Extensions customer-reported Service Attention
Dominant language
C#
Stars
4.8k
Forks
4.3k
Avg merge
3d 14h
Merged PRs (30d)
54

Description

### Description

Hi, are there any differences between the Powershell cmldet Remove-AzVMExtension and performing the same from the Azure portal >VM's blade > Extensions > HybridExtensionWorkerExtension > Uninstall?

When performing the uninstall from the Azure portal UI, the below Registry key is deleted:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\HybridRunbookWorkerV2
And the Registry entries under this HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Azure\HybridWorker\ are removed as well.

When running the `Get-AzVMExtension -ResourceGroupName "rgname" -VMName "vmname" | ? {$_.Name -eq "HybridWorkerExtension"} | Remove-AzVMExtension -Force -Verbose` cmdlet, these registry entries are not deleted and it's breaking the Set-AzVMExtension when the cmdlet is run next time, getting stuck in a "Transitioning" state and manual uninstall of the extension is required.

Is there a Powershell cmdlet that would properly uninstall the Az VM Extension?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.