A quick search around MSDN came up with the command for removing the BGInfo extension:
Get-AzureVM -ServiceName “cloudservice” -name “vmname” | Set-AzureVMBGInfoExtension -Disable -ReferenceName “BGInfo” | Update-AzureVM
Alas, it wasn’t going to be that easy and I was presented with this lovely error:
BadRequest: Cannot upgrade a resource extension reference BGInfo in Role vmname to state Disable.
VM1 = Get-AzureVM -ServiceName “cloudservice” -Name “vmname”
Set-AzureVMBGInfoExtension -VM $VM1 –Uninstall -ReferenceName “BGInfo” | Update-AzureVM
Even that threw up an error as well. I then proceed to the same above command but i put in -debug at the end which showed me something about unable to remove version 1 of bginfo. so that got me curious and i wanted to see what version of bginfo I have
Get-AzureVM -ServiceName “cloudservice” -name “vmname” | Get-AzureVMBGInfoExtension
Now this makes sense, so this means, i have to upgrade to version 2 before i can uninstall it
Get-AzureVM -ServiceName “cloudservice” -name “vmname” | Set-AzureVMBGInfoExtension | Update-AzureVM
Now i look at version number and see below

Now I want to remove this guys , so supply below command
$VM1 = Get-AzureVM -ServiceName “cloudservice” -Name “vmname”
Set-AzureVMBGInfoExtension -VM $VM1 –Uninstall -ReferenceName “BGInfo” | Update-AzureVM
This now looks good
Thats it. so looks like removing via the portal is a lot easier.
My Previous post talks about how to migrate a VNET from ASM to ARM





Leave a Reply