Error with BlobContainerClient.CreateIfNotExists()

Mohan Raju 0 Reputation points
2024-09-12T06:46:07.62+00:00

I'm encountering an error while attempting to create a container with the following code:

Uri accountUri = new Uri(containerEndpoint);

BlobServiceClient serviceClient = new BlobServiceClient(accountUri, new DefaultAzureCredential());

BlobContainerClient containerClient = serviceClient.GetBlobContainerClient(providerToUse.ContainerName);

containerClient.CreateIfNotExists();

How can I resolve this exception?

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
2,920 questions
{count} votes

1 answer

Sort by: Most helpful
  1. KarishmaTiwari-MSFT 20,207 Reputation points Microsoft Employee
    2024-09-13T19:11:56.21+00:00

    @Mohan Raju Checking in to see if the response helped.

    If you are seeing this error: The specified container already exists., refer to this post and check if any suggested solutions help: https://github.com/Azure/azure-sdk-for-net/issues/28549

    In order to help you better, we need more details on the exception/error you are seeing. Please share and we will investigate. Thanks.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.