An Azure networking service that is used to provision private networks and optionally to connect to on-premises datacenters.
The error indicates that Azure VM Image Builder is blocked by network/security configuration when trying to access the source VHD in the storage account. In the available guidance, similar failures are caused by missing or incorrect permissions or access on the storage account or other required resources.
To fix this, validate and adjust the following areas that are called out for VM Image Builder:
- Confirm VM Image Builder identity and role assignments
VM Image Builder uses a managed identity to access source images and storage.- Get the identity on the image template:
az image builder identity show -g <template resource group> -n <template name> - List its role assignments:
az role assignment list --assignee <identity_client_id_or_principal_id> - Ensure this identity has appropriate roles (for example, read access) on:
- The storage account/resource group that contains the VHD (
vhds/...vhd). - Any Azure Compute Gallery or managed image resource groups used as source or distribution.
- The storage account/resource group that contains the VHD (
- Get the identity on the image template:
- Ensure VM Image Builder has required permissions on all resources
VM Image Builder might need permissions to:- The source image or Azure Compute Gallery resource group.
- The distribution image or Azure Compute Gallery resource.
- The storage account, container, or blob that the
Filecustomizer or source VHD is accessing.
- Check for network/security policies blocking access
The prerequisites highlight that:- VM Image Builder must be able to connect to the storage account and create resources in the staging resource group.
- Azure Policy or other controls must not prevent creation/use of required resources (for example, storage accounts, container instances, virtual networks, private endpoints, Azure Files).
- Storage account firewall and network rules to ensure the VM Image Builder service and its staging resources can reach the storage account.
- Any Azure Policy assignments that might be blocking or modifying required resources.
- Verify staging resource group configuration
VM Image Builder creates resources in a staging resource group. Conflicts or restrictions on this group can cause build failures.- Ensure the staging resource group name is unique per template.
- Ensure no policies or NSG rules on the staging resources block outbound access to the storage account.
- Inspect build failure details
For more precise diagnostics:- Get the build failure status:
az image builder show --name $imageTemplateName --resource-group $imageResourceGroup - Use
lastRunStatusand then reviewcustomization.logfrom thepackerlogscontainer in the staging resource group storage account to see exactly where the access is denied.
- Get the build failure status:
If, after confirming network rules, the issue persists, focus on ensuring the VM Image Builder managed identity has the correct role assignments on the storage account and that no Azure Policy or NSG on the staging resources is blocking the outbound call to the VHD blob.
References:
- Troubleshoot Azure VM Image Builder
- Troubleshoot Azure VM Image Builder - Prerequisites
- Troubleshoot Azure VM Image Builder - Troubleshoot image template submission errors
- Troubleshoot Azure VM Image Builder - Troubleshoot build failures
- Troubleshoot Azure VM Image Builder - Troubleshoot common build errors