AZURE

BlobServiceUnavailable - Blob Service Unavailable: Temporary Service Outage

When BlobServiceUnavailable appears, Azure's blob storage is down in your region—could be planned maintenance, an unplanned outage, or throttling from peak load. This 503 server-side error means Azure's platform is the problem, not your request. The service returns 503 during these windows. You'll see this most when accessing blob storage for VM disk backups, but it also happens with AKS container images, Azure SQL database backups, and App Service application files. Usually transient—exponential backoff retries or waiting for service restoration typically fixes it.

#Common Causes

  • Planned Maintenance Windows: Azure performs scheduled maintenance on storage infrastructure, causing temporary unavailability. Maintenance is typically announced in advance via Azure Service Health. This is transient—waiting for maintenance to complete and retrying helps.
  • Regional Service Outages: The storage service in a specific region experiences an unplanned outage affecting all storage accounts in that region. Outages may be partial or complete. This is transient—waiting for service restoration or using a different region may work.
  • High Service Load Throttling: Request rates exceed service capacity, causing the service to throttle and return 503 errors during peak load periods. This is transient—retrying with exponential backoff helps distribute load over time.

Solutions

  1. 1Step 1: Diagnose - Check Azure Service Health status for maintenance schedules and outages: Visit https://status.azure.com/ or use Azure Portal > Service Health Look for storage service incidents in your region.
  2. 2Step 2: Diagnose - Test connectivity to the storage account: az storage account show --name <account-name> --resource-group <rg> --query "{provisioningState:provisioningState,statusOfPrimary:statusOfPrimary}" --output table
  3. 3Step 3: Fix - Implement retry logic with exponential backoff in your application. Use the code example below to handle 503 errors gracefully.
  4. 4Step 4: Fix - If regional outage persists, consider using a different storage account in another region or enabling geo-redundant storage (GRS) for automatic failover.
  5. 5Step 5: Fix - For high load scenarios, reduce request rates, implement client-side throttling, or batch operations to reduce concurrent requests.
  6. 6Step 6: Verify - After implementing retry logic or waiting for service restoration, retry your operation. It should eventually succeed instead of returning 503.

</>Code Examples

Blob Service Availability Check and Retry Logic
1# This script helps diagnose BlobServiceUnavailable by checking service health and implementing retry logic
2
3# Step 1: Set storage account details (replace with your values)
4STORAGE_ACCOUNT="mystorageaccount"
5RESOURCE_GROUP="my-resource-group"
6CONTAINER_NAME="mycontainer"
7BLOB_NAME="myblob.txt"
8# Note: For production, use managed identity or SAS tokens instead of account key
9ACCOUNT_KEY="your-storage-account-key"
10
11# Step 2: Check storage account status
12echo "Checking storage account status..."
13az storage account show \
14  --name ${STORAGE_ACCOUNT} \
15  --resource-group ${RESOURCE_GROUP} \
16  --query "{provisioningState:provisioningState,statusOfPrimary:statusOfPrimary,primaryLocation:primaryLocation}" \
17  --output table
18
19# Step 3: Test blob service connectivity
20echo "Testing blob service connectivity..."
21if az storage blob list \
22  --account-name ${STORAGE_ACCOUNT} \
23  --account-key ${ACCOUNT_KEY} \
24  --container-name ${CONTAINER_NAME} \
25  --output table 2>&1; then
26  echo "Blob service is accessible"
27else
28  ERROR_CODE=$?
29  echo "Blob service unavailable (exit code: ${ERROR_CODE})"
30  echo "This may indicate:"
31  echo "  1. Service maintenance in progress"
32  echo "  2. Regional outage"
33  echo "  3. High service load causing throttling"
34fi
35
36# Step 4: Retry function with exponential backoff
37retry_blob_operation() {
38  local max_attempts=${1:-5}
39  local base_delay=${2:-2}
40  local max_delay=${3:-60}
41  local attempt=1
42  shift 3
43  local command="$@"
44  
45  while [ ${attempt} -le ${max_attempts} ]; do
46    echo "Attempt ${attempt} of ${max_attempts}..."
47    
48    if eval "$command" 2>&1; then
49      echo "Operation succeeded on attempt ${attempt}"
50      return 0
51    else
52      ERROR_OUTPUT=$(eval "$command" 2>&1 >/dev/null)
53      
54      # Check if error is 503 Service Unavailable
55      if echo "$ERROR_OUTPUT" | grep -q "503|ServiceUnavailable|BlobServiceUnavailable"; then
56        if [ ${attempt} -lt ${max_attempts} ]; then
57          # Calculate delay with exponential backoff
58          DELAY=$((base_delay * (2 ** (attempt - 1))))
59          if [ ${DELAY} -gt ${max_delay} ]; then
60            DELAY=${max_delay}
61          fi
62          
63          echo "Service unavailable (503). Waiting ${DELAY} seconds before retry..."
64          sleep ${DELAY}
65          attempt=$((attempt + 1))
66        else
67          echo "Failed after ${max_attempts} attempts due to service unavailability"
68          return 1
69        fi
70      else
71        echo "Operation failed with unexpected error:"
72        echo "$ERROR_OUTPUT"
73        return 1
74      fi
75    fi
76  done
77  
78  return 1
79}
80
81# Step 5: Example usage - List blobs with retry
82echo "Listing blobs with retry logic..."
83retry_blob_operation 5 2 60 "az storage blob list \
84  --account-name ${STORAGE_ACCOUNT} \
85  --account-key ${ACCOUNT_KEY} \
86  --container-name ${CONTAINER_NAME} \
87  --output table"
88
89# Step 6: Check Azure Service Health (requires manual check)
90echo ""
91echo "To check Azure Service Health:"
92echo "  1. Visit: https://status.azure.com/"
93echo "  2. Or use Azure Portal > Service Health"
94echo "  3. Look for 'Storage' service incidents in your region"
95echo ""
96echo "Retry best practices:"
97echo "  - Start with 2 second delay, double each retry"
98echo "  - Maximum delay: 60 seconds"
99echo "  - Maximum attempts: 5"
100echo "  - Respect Retry-After headers if provided"

Related Errors

Provider Information

This error code is specific to AZURE services. For more information, refer to the official AZURE documentation.

BlobServiceUnavailable - Blob Service Unavailable: Temporary Service Outage | AZURE Error Reference | Error Code Reference