I am writing a script that:
- takes a snapshot of a data disk that is attached to a running VM
- copies the snapshot to different storage account (using
- deletes the snapshot
This seems to work as it is. However, I note that the copy operation is asynchronous, and is not likely complete by the time I run the command to delete the snapshot. The snapshot appears to be gone right away.
Do I need to wait for the copy status of the blob to be 'complete' before I delete the snapshot, or does the Azure infrastructure handle this in the background? I am not getting any exceptions thrown in the script.