Closed nturinski closed 3 years ago
Tested this with a VM made in the portal and it deleted the wrong nsg. I'm assuming there can be multiple nsg to a vn, so I'll have to check to make sure it's in the same resource group.
Okay, actually this might be either a.) special behavior due to my subscription's rules or b.) a bug on the portal.
The nsg is created in the portal, but isn't actually linked to the VM in anyway. It's not associated with the subnet, which is what hooks up the virtual network to the network interface. It's kind of annoying, because then we don't clear the resource group, but the cleanupservice is kind of specific to us, so I'm not sure if most users will run into this. Expected:
Actual:
New look! 🔥
I feel like this message looks a little ugly now (especially the long running notification). Maybe keep that as "selected resources"?
Fixes https://github.com/microsoft/vscode-azurevirtualmachines/issues/11
Give the user the option to delete every resource that we created with the VM. That includes the disk, the network interface, the virtual network, the public ip, and the network security group. If the rg if empty that, then we delete that as well.
The prompt looks like this:
Because I didn't want one delete failing to stop the entire action, it's wrapped in a try/catch. The output with an error looks like the following: