Downloadable Files
How to Create a Downloadable File from Azure
Azure Blob Storage allows you to generate a Shared Access Signature (SAS) token, which provides secure, time-limited access to your blobs (files) without sharing your account key. This guide will walk you through the steps to create a downloadable link using a SAS token.
Using Portal:
Step 1: Log in to the Azure Portal
- Go to the Azure Portal.
- Log in with your Azure account credentials.
Step 2: Navigate to Your Storage Account
- In the Azure Portal, search for “Storage accounts” in the search bar at the top.
- Click on “Storage accounts” in the search results.
- Select the storage account that contains the blob (file) you want to share.
Step 3: Access the Blob Service
- In the storage account overview, scroll down to the “Blob service” section in the left-hand menu.
- Click on “Containers” to view the list of containers in your storage account.
- Select the container that holds the blob you want to create a link for.
Step 4: Generate the SAS Token
- Inside the container, find and click on the blob (file) you want to share.
- At the top of the blob’s properties window, click on “Generate SAS” (sometimes labeled as “Shared Access Signature”).
- In the SAS token generation window, configure the following options:
- Permissions: Select the permissions you want to grant. For a downloadable link, you typically need Read permissions.
- Start and Expiry Date/Time: Set the start time and expiry time for the token. This defines how long the link will be valid.
- After configuring the settings, click “Generate SAS token and URL”.
Step 5: Copy the SAS URL
- Once the SAS token and URL are generated, you’ll see a URL in the “Blob SAS URL” field.
- Copy the entire URL. This is your downloadable link.
Using Azure SDK for Python
You can use the azure-storage-blob
library to generate a SAS token programmatically with python:
Installation
First, install the Azure Blob Storage SDK for Python:
Python Code Example
Was this page helpful?