How to know number of files in blob container

Anshal 2,251 Reputation points
2023-06-15T08:42:22.6533333+00:00

Hi friends, how to know number of files in blob container ? is there any simple way

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

Accepted answer
  1. Richard Redgrave 900 Reputation points Microsoft Employee
    2023-06-15T09:32:00.7466667+00:00

    Hi Anshal,

    The quickest way is to use the Azure CLI and use the below command. You can use the Cloud Shell User's image

    at the top right of the Azure portal to perform this.

    This will give you a total number of blobs. Also, if you remove the line "-query "length(@)" it will show the actual blob files details.

    This method authenticates using Azure AD, so make sure you have at least the "Storage Blob data reader" role on the storage account, below performing the command

    Hopefully this helps you

    az storage blob list \     
        --account-name <storage account> \     
        --container-name <container> \     
        --query "length(@)" \     
        --output table \ 
        --auth-mode login
    
    2 people 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.