AZURE

BlobNotFound - Blob Not Found: Blob Does Not Exist

The blob doesn't exist in the container—either the name/path is wrong, the case doesn't match (blobs are case-sensitive), or the blob was soft-deleted and still in retention. This 404 client-side error occurs after Storage validates the blob name format but can't find it in the container. Blob names support virtual directory paths using forward slashes (e.g., "folder/blob.txt" vs "folder/subfolder/blob.txt" are different), and paths must match exactly. Soft-deleted blobs exist during retention but aren't accessible via standard GET operations. Common when accessing blobs for VM disk backups, AKS container images, Azure SQL backups, or App Service application files.

#Common Causes

  • Blob Name Case Mismatch: Blob names are case-sensitive. "MyBlob.txt" and "myblob.txt" are different blobs. The blob name case doesn't exactly match the stored blob name.
  • Soft-Deleted Blob: Soft-deleted blobs exist in a "Deleted" state with the retention period still active. During retention, standard GET operations return BlobNotFound even though the blob technically exists. Retention period is configurable but varies.
  • Virtual Directory Path Mismatch: Blob path segments don't match the stored blob path. Forward slashes create virtual directories, so "folder/blob.txt" and "folder/subfolder/blob.txt" are different paths. The path structure doesn't match exactly.
  • Blob Never Existed: The blob was never created or was permanently deleted after the retention period expired. Verify the blob name and path are correct.

Solutions

  1. 1Step 1: Diagnose - List all blobs to see what exists: az storage blob list --container-name <container> --account-name <account> --account-key <key> --query "[].name" --output table
  2. 2Step 2: Diagnose - Check for soft-deleted blobs: az storage blob list --container-name <container> --account-name <account> --account-key <key> --include deleted --output table
  3. 3Step 3: Diagnose - Verify blob name and path structure. Blob names are case-sensitive, and virtual directory paths must match exactly.
  4. 4Step 4: Fix - Restore soft-deleted blob if found: az storage blob undelete --container-name <container> --name <blob> --account-name <account> --account-key <key>
  5. 5Step 5: Fix - Create blob if it doesn't exist. Verify the blob name and path are correct before creating.
  6. 6Step 6: Verify - Retry blob operation. It should succeed instead of returning BlobNotFound.

</>Code Examples

Blob Lookup and Recovery
1# This script helps diagnose BlobNotFound errors
2
3# Step 1: Set storage account details (replace with your values)
4STORAGE_ACCOUNT="mystorageaccount"
5CONTAINER_NAME="mycontainer"
6BLOB_NAME="myblob.txt"
7# Note: For production, use Azure Key Vault or managed identity instead of account key
8ACCOUNT_KEY="your-storage-account-key"
9
10# Step 2: List all blobs in container to see what exists
11echo "Listing all blobs in container $CONTAINER_NAME..."
12az storage blob list \
13  --container-name $CONTAINER_NAME \
14  --account-name $STORAGE_ACCOUNT \
15  --account-key $ACCOUNT_KEY \
16  --query "[].{name:name, size:properties.contentLength, lastModified:properties.lastModified}" \
17  --output table
18
19# Step 3: Check if blob exists
20echo "Checking if blob $BLOB_NAME exists..."
21if az storage blob show \
22  --container-name $CONTAINER_NAME \
23  --name $BLOB_NAME \
24  --account-name $STORAGE_ACCOUNT \
25  --account-key $ACCOUNT_KEY \
26  --output table 2>&1; then
27  echo "Blob found and accessible"
28else
29  echo "Blob not found. Continuing diagnosis..."
30fi
31
32# Step 4: Check for soft-deleted blobs
33echo "Checking for soft-deleted blobs..."
34az storage blob list \
35  --container-name $CONTAINER_NAME \
36  --account-name $STORAGE_ACCOUNT \
37  --account-key $ACCOUNT_KEY \
38  --include deleted \
39  --query "[?name=='$BLOB_NAME'].{name:name, deleted:properties.deleted, deletionTime:properties.deletionTime}" \
40  --output table
41
42# Step 5: Restore soft-deleted blob if found
43echo "Attempting to restore soft-deleted blob..."
44if az storage blob undelete \
45  --container-name $CONTAINER_NAME \
46  --name $BLOB_NAME \
47  --account-name $STORAGE_ACCOUNT \
48  --account-key $ACCOUNT_KEY 2>&1; then
49  echo "Blob restored successfully"
50else
51  echo "Blob could not be restored (may not be soft-deleted or retention period expired)"
52fi
53
54# Step 6: Search for blobs with similar names (case-insensitive search)
55echo "Searching for blobs with similar names..."
56az storage blob list \
57  --container-name $CONTAINER_NAME \
58  --account-name $STORAGE_ACCOUNT \
59  --account-key $ACCOUNT_KEY \
60  --query "[?contains(name, '$(echo $BLOB_NAME | tr '[:upper:]' '[:lower:]')')].{name:name}" \
61  --output table
62
63# Step 7: Note about case sensitivity and virtual directories
64echo ""
65echo "Important notes:"
66echo "  1. Blob names are case-sensitive ('MyBlob.txt' != 'myblob.txt')"
67echo "  2. Virtual directory paths must match exactly ('folder/blob.txt' != 'folder/subfolder/blob.txt')"
68echo "  3. Soft-deleted blobs can be restored if retention period hasn't expired"
69echo "  4. Verify exact case and path structure when referencing blobs"

Related Errors

Provider Information

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

BlobNotFound - Blob Not Found: Blob Does Not Exist | AZURE Error Reference | Error Code Reference