An Azure service that is used to provision Windows and Linux virtual machines.
I understand you are wanting to delete a VM via REST API but are running into the above error. Can you try running detach disk and then running the delete?
You need to run VM update first to detach the disk. You can find a sample here which is using the data disk.
Please try this and let me know if it works for you.
-------------------------------
Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.