[Feature] Resolve `${VAR}` interpolation in `azure.yaml` `image:` after predeploy hooks run
- Dominant language
- Go
- Stars
- 569
- Forks
- 364
- Avg merge
- 2d 19h
- Merged PRs (30d)
- 136
Description
### 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:
```yaml
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`](https://github.com/Azure/azure-sdk-tools/tree/main/tools/sdk-ai-bots/deployment). We currently work around this with a TypeScript hook._
Contributor guide
Research direction
Start by tracing how azure.yaml interpolation is handled during the azd provision/deploy lifecycle and when predeploy hooks run. Review the TypeScript hook and its .env workaround in tools/sdk-ai-bots/deployment. Done means a hook-produced immutable image tag is available to the image field after the hook and is deployed by azd.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, go, typescript
- Domain
- cli, cloud, devops
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100