Export file metadata from Azure blob storage

Paul 21 Reputation points
2022-12-14T17:23:29.92+00:00

Hello,

We have several thousand files stored in Blob and would like to export a list of the file name and the URL, rather than having to click into the properties for each file and manually copy the URL value. Is there a way to do this?

Thank you!

Azure Storage
Azure Storage
Globally unique resources that provide access to data management services and serve as the parent namespace for the services.
3,543 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,202 questions
0 comments No comments
{count} votes

Accepted answer
  1. Ramya Harinarthini_MSFT 5,366 Reputation points Microsoft Employee Moderator
    2022-12-14T18:27:39.023+00:00

    @Paul Welcome to Microsoft Q&A, thank you for posting your here!!

    We can fetch the blob names and blob url using List blob Rest API and you can refer the below example provided in this article which returns blobs and snapshots in a container. From the request URI you can remove &include=snapshot to only list the blobs.

    The request URI is as follows:

    GET https://myaccount.blob.core.windows.net/mycontainerrestype=container&comp=list&include=metadata  
    

    Another way to list the blob names is by using the below Azure PowerShell script which will list all the blobs inside the container

    $rg = "resourcegroupname"  
    $storageaccount = "Storageaccountname"  
    $key = (Get-AzStorageAccountKey -ResourceGroupName $rg -Name $storageaccount)[0].Value  
    $context = New-AzStorageContext -StorageAccountName $storageaccount -StorageAccountKey $key  
    $ContainerName = "Containername"  
    Get-AzStorageBlob -Container $ContainerName -Context $Context | Select-Object -Property Name  
    

    Output looks like below which list the blob names (path i.e directoryname/filename) and you can construct the blob URL to generate the relevant URL: https://myaccount.blob.core.windows.net/mycontainer/myblob

    Name

    -----------------

                                                              cachetest098-0-1-rdb/2:7d23c6c7-3815-4fb9-8a29-1bff4f8ac185:backup:0   
    

    cachetest098-0-1-rdb/2:7d23c6c7-3815-4fb9-8a29-1bff4f8ac185:backup:1

    Hope this helps!
    Kindly let us know if the above helps or you need further assistance on this issue.

    ---------------------------------------------------------------------------------------------------------------------------

    Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    1 person found this answer helpful.

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.