Skip to content

How do I determine if a storage container or blob exists? #12744

@dharmab

Description

@dharmab

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+?

Metadata

Metadata

Labels

ClientThis issue points to a problem in the data-plane of the library.Service AttentionWorkflow: This issue is responsible by Azure service team.StorageStorage Service (Queues, Blobs, Files)customer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions