Search code examples
azureazure-blob-storageblobazure-storage-account

Public access level : Blob vs Container


What is the difference between Container and Blob when it comes to Public access level ? (see blue frame on below picture)

According to microsoft definition :

A container organizes a set of blobs, similar to a directory in a file system. A storage account can include an unlimited number of containers, and a container can store an unlimited number of blobs.

But I don't understand what is has to do with the public access level.

enter image description here


Solution

  • Simply put, public access level controls if you can access a blob (or a container's properties) anonymously simply by using just the URL for the resource.

    Explanation of different public access levels is provided here: https://learn.microsoft.com/en-us/rest/api/storageservices/get-container-acl.

    To elaborate more on the documentation, if the access level is:

    • Private: You cannot access a resource by using the resource URL. For example, if your blob's URL is https://account.blob.core.windows.net/container/blob.txt and if you try to access this resource in a browser, you will receive a 404 error even though the blob is present.
    • Blob: You can download a blob or get its properties by using the URL. However you will not be able to access a container's properties if the access level is set as Blob.
    • Public: It is similar to Blob public access level but if the ACL for a container is set as public, you can get a container's properties as well as list blobs in that container.