(Initial Version - more details soon)
This is an emergent application to help users browse and download the contents of an Azure storage account. Why? Many applications, but the main motivation is to provide a convenient means of accessing Azure Blob storage and data from other applications, an example being SAS.
This requirements.txt file in the build directory provides a list of required Python packages (plus some optional conveniences) which you can either install in your Python environment or a virtual Python environment.
This build.sh shell script provides instructions and commands to create a virtual environment and install packages.
git clone https://github.com/SundareshSankaran/azure_blob_quickstart.git
cd build
./build.shPrerequisite: Check with your Azure Storage Account admin to ensure you have appropriate permissions to perform desired operations on an account. Obtain an access key and save it in a .env file in your local repo folder. Take care to protect your key.
AZURE_STORAGE_CONNECTION_STRING="<your key>"
With some modification, you can also use the passwordless auth mechanism. Refer here.
- Standalone Python Program: Refer block_quickstart.py
Here are snippets for the operations you can perform:
- List containers
python blob_quickstart.py list_containers- List blobs in a container
python blob_quickstart.py list_blobs <container_name> - Search for a blob (based on a name pattern) in a container
python blob_quickstart.py search_blob <container_name> <search_term>- Download a blob
python blob_quickstart.py download_blob <container_name> <blob_name> <download_path_on_client_machine>- Upload a local file to a blob
python blob_quickstart.py upload_blob <container_name> <path_to_file_on_local_machine> <blob_name>Or, optionally, if you omit the blob name, the local file name will be used instead.
python blob_quickstart.py upload_blob <container_name> <path_to_file_on_local_machine> -
Python Class: The Python class defined here: blob_access_class.py provides the same functionality as methods accessible from an instance of a BlobAccessClass. Refer this example notebook for details on how to use.
-
Streamlit app:
# Ensure you activate the virtual environment
. build/azureblobtest/bin/activate
cd azure-blob-streamlit-app
streamlit run src/app.py
- For SAS users: In addition to the Python-based interfaces mentioned above, also check out this folder for an example of how to use the SAS/Access Interface to DuckDB (available in Viya 2025.07 onwards) to read from Azure blob storage.
- @SundareshSankaran (email)
- Version 0.2.0 (see Change Log for details)