Summary
With the azure.ai.agent host (azure.ai.agents beta.5), the "Registering agent environment variables" step is effectively a no-op: the environment_variables declared in agent.yaml are not embedded into the deployed agent version's definition.
What happens
Our hosted Foundry agent crashes on boot:
AZURE_APPCONFIG_ENDPOINT env var is required
-> 424 session_not_ready
-> /agent/chat returns 500
even though AZURE_APPCONFIG_ENDPOINT is declared in agent.yaml. The deployed version simply doesn't carry the env.
Related: azure.yaml ${VAR} interpolation for image: is resolved at project-load (before predeploy), so we also can't point image: at the freshly-built immutable tag. (Filed separately.)
Current workaround
agent-postdeploy.ts -> ensureAgentAppConfigEnv() uses the Foundry data-plane API:
GET .../agents/<name>/versions/@latest
- if
image != AGENT_DEPLOYED_IMAGE or environment_variables.AZURE_APPCONFIG_ENDPOINT is missing -> POST a new version cloning the definition, pinning the image, embedding env
- idempotent — no-op when already correct
Ask
The azure.ai.agent host should actually persist agent.yaml environment_variables (and the pinned image) into the deployed version's definition. That would let us delete ensureAgentAppConfigEnv.
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
With the
azure.ai.agenthost (azure.ai.agentsbeta.5), the "Registering agent environment variables" step is effectively a no-op: theenvironment_variablesdeclared inagent.yamlare not embedded into the deployed agent version's definition.What happens
Our hosted Foundry agent crashes on boot:
even though
AZURE_APPCONFIG_ENDPOINTis declared inagent.yaml. The deployed version simply doesn't carry the env.Related:
azure.yaml${VAR}interpolation forimage:is resolved at project-load (before predeploy), so we also can't pointimage:at the freshly-built immutable tag. (Filed separately.)Current workaround
agent-postdeploy.ts->ensureAgentAppConfigEnv()uses the Foundry data-plane API:GET .../agents/<name>/versions/@latestimage != AGENT_DEPLOYED_IMAGEorenvironment_variables.AZURE_APPCONFIG_ENDPOINTis missing ->POSTa new version cloning the definition, pinning the image, embedding envAsk
The
azure.ai.agenthost should actually persistagent.yamlenvironment_variables(and the pinned image) into the deployed version's definition. That would let us deleteensureAgentAppConfigEnv.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.