Skip to main content
POST
/
user
/
blob
Configure Azure Blob Storage
curl --request POST \
  --url https://api.tornadoapi.io/user/blob \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <x-api-key>' \
  --data '
{
  "account_name": "<string>",
  "container": "<string>",
  "account_key": "<string>",
  "sas_token": "<string>",
  "folder_prefix": "<string>",
  "base_folder": "<string>"
}
'
{
  "message": "Azure Blob storage configured successfully",
  "provider": "blob",
  "container_or_bucket": "tornado-downloads"
}

Overview

Set up Azure Blob Storage for uploaded videos. Authenticate with either an account key or a SAS token. Credentials are verified before saving.

Header Parameters

x-api-key
string
required
Your API key for authentication

Request Body

account_name
string
required
Azure Storage Account name
container
string
required
Blob container name
account_key
string
Storage Account access key (Base64 encoded). Required if sas_token is not provided.
sas_token
string
SAS token for authentication. Required if account_key is not provided.
folder_prefix
string
Optional folder prefix for organizing uploads (e.g., downloads/2024/)
base_folder
string
default:"videos"
Base folder name for uploaded files. Defaults to videos if not specified. Set to a custom value to change the top-level folder where files are stored (e.g., downloads, media).
Provide either account_key OR sas_token, not both. At least one must be provided.

Response

message
string
Success confirmation message
provider
string
Storage provider type: blob
container_or_bucket
string
The configured container name
folder_prefix
string
The configured folder prefix (if provided)

Examples

curl -X POST "https://api.tornadoapi.io/user/blob" \
  -H "x-api-key: sk_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
    "account_name": "mystorageaccount",
    "container": "tornado-downloads",
    "account_key": "xxxxxxxxxxxxxxxxxxxxxxxxxxx=="
  }'

Success Response

{
  "message": "Azure Blob storage configured successfully",
  "provider": "blob",
  "container_or_bucket": "tornado-downloads"
}

Error Responses

{
  "error": "Either account_key or sas_token must be provided"
}

Verification Process

When you submit storage configuration, Tornado:
  1. Validates that either account_key or sas_token is provided
  2. Creates a storage client with your credentials
  3. Attempts to upload a small test file (verify_credentials.txt)
  4. Deletes the test file
  5. If successful, saves the configuration encrypted

Required SAS Permissions

When using a SAS token, ensure these permissions are enabled:
  • Read (r) - For generating download URLs
  • Write (w) - For uploading files
  • Delete (d) - For cleanup operations
  • List (l) - For validation