3

I want to list (programmatically) the url of my blob storage. The url I am looking for is https://my_storageaccount_name.blob.core.windows.net/my_container_name/my_file_name

I tried az storage account list and az storage blob show but neither of them display the url.

There is a az storage blob url but that creates a url. I am interested in listing the url.

Does anyone know how to obtain this ?

souser
  • 5,868
  • 5
  • 35
  • 50

2 Answers2

3

If the url for the blobs is always

https://my_storageaccount_name.blob.core.windows.net/my_container_name/my_file_name

without any custom domains configured, just list all containers with blobs, take the container name and blob name, and put it in the URL.

Ref: https://my_storageaccount_name.blob.core.windows.net/my_container_name/my_file_name

Tomasz Kaniewski
  • 1,065
  • 8
  • 16
  • This does not return the full URL property value for the Blob, which would include the VersionId. – Kevin Nov 09 '22 at 23:59
0

You can get Storage account URL Using

az storage account show --name $storage_account_name --resource-group $ResourceGroup --query "primaryEndpoints.blob")

or all the properties without using query from which you can pick whichever property you want

az storage account show --name $storage_account_name --resource-group $ResourceGroup