I have to delete Azure VM and associated resources using REST API calls.
I have sequential calls to delete Azure VM -> VM-Disk -> VM-Ip -> VM-NSG -> VM-Vnet
But after deleting VM, api call fails for Ip and NSG etc saying they are still in use.
Am wondering if I have to keep some buffer after which I should try.
Should I use some sort of Thread.Sleep for x time to delete NIC, IP etc after VM deletion ?