-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I determine if a storage container or blob exists? #12744
Comments
Thanks for the feedback! We are routing this to the appropriate team for follow-up. cc @xgithubtriage. |
Hi @dharmab Thanks for reaching out! We have an feature request to add exists() api, so users will be less confused about this. |
Hi @dharmab the |
Sorry to highjack this a little. I was trying to use
to check if a container existed. I had expected either an immediate
I have also tried all the timeout Will the Thanks. PS: Please advise if I should instead open another issue! |
Hi @AkhilGNair, interesting issue you've come across, but this is actually an unexpected behavior. The error you're getting implies the request was not sent (you would receive a |
Thanks @tasherif-msft, done! |
Just FYI, I dont believe the azure docs have been updated to reflect that this new exists() method is available (unless I'm looking in the wrong location): |
Hi @wheezymustafa, its actually in the link you've just sent! https://docs.microsoft.com/en-us/python/api/azure-storage-blob/azure.storage.blob.blobclient?view=azure-python#exists---kwargs- |
[AML] Add PipelineEndpoint with version and DataPathAssignments fields in AzureMLExecutePipeline (Azure#12744) * Update Pipeline.json Add PipelineEndpoint with version and DataPathAssignments fields in AzureMLExecutePipeline * update * update * nit
I Tried Follwoing Code, It Didn't work for me from azure.storage.blob import BlobClient
blob_client = BlobClient("url of Storage account", "container name", "Blob Name", snapshot=None, credential="credential of Storage Account")
print(blob_client.exists()) I got the Following Error:
|
Even this is giving the same error: test = ContainerClient("{}://{}.dfs.core.windows.net".format("https", "storage account name"), "container name", credential="Storage Account")
print(test.list_blobs(name_starts_with="blob name")) |
In older versions of the Azure SDK for Python, I could call
BaseBlobService.exists()
to check if a container or blob exists.I don't see any equivalent function in the documentation for BlobServiceClient, ContainerClient or BlobClient. The functions to create/overwrite a container or blob will throw an error if the object already exists, but there are times when I just want to verify something exists without modifying it.
What is the correct way to check if a blob exists in azure-storage-blob v12+?
The text was updated successfully, but these errors were encountered: