How do I determine if a storage container or blob exists?
See original GitHub issueIn 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+?
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:10 (4 by maintainers)
Top Results From Across the Web
How do you check that a container exists in Azure Blob ...
In v12, there are 2 ways to check if the container exists or not. 1. BlobServiceClient blobServiceClient = new ...
Read more >BlobContainerClient.Exists(CancellationToken) Method
The Exists(CancellationToken) operation can be called on a BlobContainerClient to see if the associated container exists on the storage account in the ...
Read more >Checking if a blob exists in Azure Storage - Intellipaat
I just want to know whether a blob exists in a particular container or not. Simple question right! ... research but it seems...
Read more >How to Detect and Compromise Azure Blobs and Storage ...
A quick way to check if these logs are enabled is by going into the Azure Portal and viewing the containers within a...
Read more >Azure: Checking if a blob exists using its URI
Having only a storage account ( CloudBlobClient ) and a blob URI makes it a little bit tricky to check if the blob...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Hi @dharmab the
exists
method has been added to our SDK and will be available in this upcoming release!Hi @dharmab
Thanks for reaching out! Currently you can use blob_client.get_blob_properties() and it will throw ResourceNotFoundError if the blob/container/blob_snapshot doesn’t exist.
We have an feature request to add exists() api, so users will be less confused about this.