list-media-files.sh
Lists all blobs in Azure Blob Storage container with a tree-structured view.Description
This script fetches all blobs from the specified Azure Storage container and displays them in a hierarchical tree structure with their full URLs. Useful for visualizing the folder structure and getting direct links to files.Prerequisites
- Azure CLI installed and configured
- Access to Azure Storage Account
- Authenticated Azure session (
az login)
Configuration
Edit these variables in the script:Usage
Pipe to Other Scripts
Output Format
Features
- Tree Structure: Displays files in a hierarchical folder view
- Full URLs: Shows complete blob URLs for easy access
- Sorted Output: Files are alphabetically sorted
- Clean Display: Uses tree-style formatting with
├──markers
Error Handling
If the script fails to fetch the storage account key:- Ensure you’re logged in:
az login - Verify you have access to the storage account
- Check the account name is correct
Performance
- Fetches all blobs in a single API call
- Efficient for containers with thousands of files
- Output is streamed, so large lists don’t consume excessive memory
Examples
Basic Usage
Save to File
Count Total Files
Filter Specific File Types
Related Scripts
- create-folder-structure.sh - Creates local folder structure from output