Rename blob containers

Michael Schmidt 365 Reputation points
2024-10-31T14:02:18.9333333+00:00

How do I rename a blob container in an Azure Storage Account? Either in the portal or via CLI? For the (virtual) folders there's a rename-Button, but not for the containers itself.

Is it not possible in the Portal?

Is it possible via CLI?

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

Accepted answer
  1. Michael Taylor 60,161 Reputation points
    2024-10-31T14:34:01.7266667+00:00

    You can't. It isn't supported. Renaming a container would break anything that relies on that container since you need the container name in order to do anything with it. Hence it isn't easy to do.

    The workaround is to do the following:

    1. Create a new container with the appropriate name and settings.
    2. Copy all the blobs from the old container to the new one.
    3. Delete the old container.

    Of course how hard or easy that is depends on what options you have enabled on the container and how many blobs are stored in it. For example if you have soft deletes enabled or DR settings then it'll probably be a pain to deal with those. You could disable the options on the old container and enable them on the new container once you're done. If you have a large # of blobs then copying them from 1 container to another is going to be slow as well.

    AzCopy was designed for this sort of thing. The docs give the syntax for copying a container from one SA to another but it should work for the same SA I believe. This is probably the easiest approach.

    1 person found this answer helpful.
    0 comments No comments

0 additional answers

Sort by: Most helpful

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.