Had a problem when trying to remove the Azure VM that we created during the lab. Following this command
remove-azvm –name LabVM –resourcegroupname JohnDoe
I was prompted to provide a ‘Yes’ [Y] but received a response that I did not have the permissions. How is this possible?
That is a little unusual – let’s see what we can do to fix this issue for you.
I’ve just walked through the lab right now, and confirmed a couple of things. Hopefully some of this will help with the problem you’re facing. Firstly, when you type the following command, you will always be prompted YES or NO. Whether or not you have entered in the name or resource group name correctly:
remove-azvm --name randomname --resourcegroupname randomcharacters
I’ve also completed the lab using the instructions, and didn’t receive any errors. The VM was able to be deleted successfully. It’s worth noting that I use the same lab environment as you (with a temporary cloud_user account, just like you) so I don’t have any more special permissions.
So one thing you might be able to try to help ensure there are no errors, is to use the TAB key.
For example, if you type "remove-azvm –name LabVM –resourcegroupname " and then press TAB – it should autocomplete the resource group name for you of your existing resource group. That will ensure your command is targeting the right resource.
Would you be able to give that a try and see if this resolves your issue?
If you find that no matter how you enter the command, and you’re confident it’s all correct, but you keep getting an error message, then would you mind reaching out to the support team so they can investigate further? You can find more information here.
I hope this helps!