A Microsoft desktop and app virtualization service that runs on Azure. Previously known as Windows Virtual Desktop.
Hi Casey Hansen (SA) & thx for join me at Q&A platform,
fact that the build succeeds only when anonymous blob access is enabled strongly suggests that the failure is occurring while Azure VM Image Builder retrieves the PowerShell script, not while the script itself executes.
For AVD Custom Image Templates, the supported way to keep the blob private is to use the managed identity selected for the image template and grant that identity Storage Blob Data Reader on the script container or blob. Microsoft explicitly documents this for custom scripts stored in Azure Storage. Microsoft Learn I would prefer that over SAS; current Image Builder guidance also recommends managed identity rather than embedding SAS credentials in scriptUri.
There is a second, separate issue if the Storage account has network restrictions. A SAS only handles authorization; it doesn't bypass the Storage firewall or private-endpoint routing. For firewall-protected Storage, current Image Builder networking guidance requires the appropriate build/ACI subnet topology and Storage network access from that path. So a URL working in your browser doesn't prove that the Image Builder service can retrieve it.
I’d also check customization.log rather than relying on the generic Internal error occurred message. The failed build's IT_<resource-group><template>... staging resource group contains the packerlogs container, and the log should show whether retrieval is returning 403, failing DNS/network connectivity, or failing later during PowerShell execution.
So I wouldn't enable anonymous blob access as the permanent workaround. Use a private container, grant the template's UAMI Storage Blob Data Reader, use the normal blob URI without a SAS, and then make sure the Image Builder network path is permitted by the Storage account. If that exact configuration still returns an internal error while customization.log shows the identity successfully reaching Storage, then it becomes an Azure VM Image Builder issue worth escalating with the build operation ID and log.
rgds,
Alex