AZURE
VMImageNotFound - VM Image Not Found: Image Unavailable or Invalid
The VM image doesn't exist or isn't available—the image URN format might be wrong (must be Publisher:Offer:SKU:Version), the image isn't published to your region, or shared image gallery images require explicit sharing permissions. This 404 client-side error occurs when ARM validates image availability before VM creation. Publisher/offer/SKU values are case-sensitive and must match exactly. Images may be region-specific or require explicit sharing from shared image galleries. The image might exist but not in your subscription or region. Similar image availability issues occur in AKS node images and App Service container images.
#Common Causes
- →Invalid Image URN Format: The image URN structure is incorrect or contains typos. The URN format must be: Publisher:Offer:SKU:Version. This is persistent—you must fix the URN format before retrying.
- →Regional Image Unavailability: The image isn't available in your selected region. Images may be region-specific or may not be published to all regions. This is persistent—you must use an available image or region.
- →Image Sharing Restriction: The image isn't shared with your subscription. Shared image gallery images require explicit sharing permissions. This is persistent—you must get sharing permissions or use a different image.
- →Publisher/Offer/SKU Mismatch: The specified values don't match available images. These values are case-sensitive and must match exactly. This is persistent—you must use the correct publisher/offer/SKU combination.
✓Solutions
- 1Step 1: Diagnose - Verify image URN format matches Publisher:Offer:SKU:Version: az vm image show --urn <image-urn> --output table
- 2Step 2: Diagnose - List available images in your region: az vm image list --location <region> --publisher <publisher> --offer <offer> --sku <sku> --output table
- 3Step 3: Diagnose - List publishers in your region: az vm image list-publishers --location <region> --output table
- 4Step 4: Diagnose - List offers from publisher: az vm image list-offers --location <region> --publisher <publisher> --output table
- 5Step 5: Diagnose - List SKUs for offer: az vm image list-skus --location <region> --publisher <publisher> --offer <offer> --output table
- 6Step 6: Fix - Use correct image URN format. Verify the URN structure matches Publisher:Offer:SKU:Version.
- 7Step 7: Fix - Use an available image in your region, or use a different region where the image is available.
- 8Step 8: Fix - Request sharing permissions for shared image gallery images, or use a different image.
- 9Step 9: Verify - Retry VM creation with the verified image. It should succeed instead of returning VMImageNotFound.
</>Code Examples
VM Image Lookup and Verification
1# This script helps diagnose VMImageNotFound errors by verifying image availability
2
3# Step 1: Set your region
4REGION="eastus"
5echo "Checking image availability in region: $REGION"
6
7# Step 2: Example image URN (replace with your actual image URN)
8IMAGE_URN="Canonical:0001-com-ubuntu-server-focal:20_04-lts:latest"
9echo "Verifying image URN: $IMAGE_URN"
10
11# Step 3: Verify image URN format (Publisher:Offer:SKU:Version)
12IFS=':' read -ra URN_PARTS <<< "$IMAGE_URN"
13if [ ${#URN_PARTS[@]} -ne 4 ]; then
14 echo "ERROR: Invalid image URN format"
15 echo "Required format: Publisher:Offer:SKU:Version"
16 echo "Example: Canonical:0001-com-ubuntu-server-focal:20_04-lts:latest"
17 exit 1
18fi
19
20PUBLISHER=${URN_PARTS[0]}
21OFFER=${URN_PARTS[1]}
22SKU=${URN_PARTS[2]}
23VERSION=${URN_PARTS[3]}
24
25echo "Publisher: $PUBLISHER"
26echo "Offer: $OFFER"
27echo "SKU: $SKU"
28echo "Version: $VERSION"
29
30# Step 4: Check if image exists
31echo "Checking if image exists..."
32if az vm image show --urn $IMAGE_URN --output table 2>&1; then
33 echo "Image found"
34else
35 echo "Image not found. Continuing diagnosis..."
36fi
37
38# Step 5: List available images by publisher
39echo "Listing available images from publisher $PUBLISHER..."
40az vm image list \
41 --publisher $PUBLISHER \
42 --offer $OFFER \
43 --sku $SKU \
44 --all \
45 --query "[].{urn:urn, location:location}" \
46 --output table
47
48# Step 6: List publishers in region
49echo "Listing publishers in region $REGION..."
50az vm image list-publishers \
51 --location $REGION \
52 --query "[?name=='$PUBLISHER']" \
53 --output table
54
55# Step 7: List offers from publisher
56echo "Listing offers from publisher $PUBLISHER..."
57az vm image list-offers \
58 --location $REGION \
59 --publisher $PUBLISHER \
60 --query "[?name=='$OFFER']" \
61 --output table
62
63# Step 8: List SKUs for offer
64echo "Listing SKUs for offer $OFFER..."
65az vm image list-skus \
66 --location $REGION \
67 --publisher $PUBLISHER \
68 --offer $OFFER \
69 --query "[?name=='$SKU']" \
70 --output table
71
72# Step 9: List versions for SKU
73echo "Listing versions for SKU $SKU..."
74az vm image list \
75 --location $REGION \
76 --publisher $PUBLISHER \
77 --offer $OFFER \
78 --sku $SKU \
79 --all \
80 --query "[].{version:version, location:location}" \
81 --output table
82
83# Step 10: Check if image is available in your region
84echo "Checking if image is available in region $REGION..."
85REGION_IMAGE=$(az vm image list \
86 --location $REGION \
87 --publisher $PUBLISHER \
88 --offer $OFFER \
89 --sku $SKU \
90 --query "[?version=='$VERSION'].urn" \
91 --output tsv)
92
93if [ ! -z "$REGION_IMAGE" ]; then
94 echo "Image is available in region $REGION: $REGION_IMAGE"
95else
96 echo "WARNING: Image may not be available in region $REGION"
97 echo "Try a different region or use a different image version"↗Related Errors
Provider Information
This error code is specific to AZURE services. For more information, refer to the official AZURE documentation.