Skip to content

[Feature] Resolve ${VAR} interpolation in azure.yaml image: after predeploy hooks run #9248

Description

@qiaozha

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions