Summary
${VAR} interpolation in azure.yaml (including a service's image:) is resolved at project-load time, which is before predeploy hooks execute. This makes it impossible to point image: at an artifact a predeploy hook produces.
What happens
Our predeploy hook builds a container and produces a fresh immutable tag (e.g. dev-N.0.0) via az acr build. We would like image: to reference that tag through an env var the hook sets:
services:
agent:
image: ${AGENT_DEPLOYED_IMAGE}
But because interpolation happens before the hook runs, ${AGENT_DEPLOYED_IMAGE} is empty/stale at the moment azd reads it — so azd can never deploy the just-built immutable tag.
Current workaround
The predeploy hook performs the container repoint itself (az ... config container set) and writes the immutable tag back to .env, bypassing azure.yaml's image: entirely.
Ask
Support late-resolved ${VAR} for fields like image: — resolve interpolation after predeploy hooks run — so a hook can hand azd the tag it just built.
Context: encountered while deploying a multi-component AI/chat service (App Service + Function App + Logic App + Foundry hosted agent) end-to-end with azd provision/deploy in Azure/azure-sdk-tools tools/sdk-ai-bots/deployment. We currently work around this with a TypeScript hook.
Summary
${VAR}interpolation inazure.yaml(including a service'simage:) is resolved at project-load time, which is before predeploy hooks execute. This makes it impossible to pointimage:at an artifact a predeploy hook produces.What happens
Our predeploy hook builds a container and produces a fresh immutable tag (e.g.
dev-N.0.0) viaaz acr build. We would likeimage:to reference that tag through an env var the hook sets:But because interpolation happens before the hook runs,
${AGENT_DEPLOYED_IMAGE}is empty/stale at the momentazdreads it — soazdcan never deploy the just-built immutable tag.Current workaround
The predeploy hook performs the container repoint itself (
az ... config container set) and writes the immutable tag back to.env, bypassingazure.yaml'simage:entirely.Ask
Support late-resolved
${VAR}for fields likeimage:— resolve interpolation after predeploy hooks run — so a hook can handazdthe tag it just built.Context: encountered while deploying a multi-component AI/chat service (App Service + Function App + Logic App + Foundry hosted agent) end-to-end with
azdprovision/deploy in Azure/azure-sdk-toolstools/sdk-ai-bots/deployment. We currently work around this with a TypeScript hook.