Is there an API call I can make to Azure Storage to tell if my container has been deleted?

大城市里の小女人 提交于 2019-12-01 13:54:51

Is there a Get-AzureStorageContainer status? "Deleting?"

Unfortunately there's none. You just have to keep on trying.

Based on the documentation here: https://msdn.microsoft.com/en-us/library/azure/dd179408.aspx

When a container is deleted, a container with the same name cannot be created for at least 30 seconds; the container may not be available for more than 30 seconds if the service is still processing the request. While the container is being deleted, attempts to create a container of the same name will fail with status code 409 (Conflict), with the service returning additional error information indicating that the container is being deleted. All other operations, including operations on any blobs under the container, will fail with status code 404 (Not Found) while the container is being deleted.

Though they are saying 30 seconds but depending on the number of blobs in the container, it may take even longer than that.

Other alternative would be to delete all blobs individually instead of deleting the container. However because each delete is a separate network call, the process may run for a longer duration (and is prone to network failures) but it would guarantee you that when you start using AzCopy, the container will be empty.

Isn't the error message enough to give you the same behavior. You can write that API yourself. Or I'm missing something?

"The specified container is being deleted. Try operation later."

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!