azure.yaml, set the azd environment value that your agent reads at runtime, and redeploy the Microsoft Foundry hosted agent.
Prerequisites
- An initialized and deployed hosted agent project. For setup, see Initialize an agent project and Deploy a hosted agent.
- The azd Foundry extensions installed.
- An authenticated
azdsession. - A target model deployment name that is available for your Foundry project and region.
Choose a model
When selecting a model, consider:Update the environment variable
There is no dedicated command for updating the model yet. Start by updating the model deployment name in your azd environment:Update azure.yaml
Model selection for hosted agents is defined in two places inazure.yaml:
- The
azure.ai.projectservice defines the model deployment in itsdeploymentslist. - The
azure.ai.agentservice defines the runtime environment variable that your agent code reads from theenvmap.
services.<project-service>.deployments[].name.
Redeploy the project
Runazd up:
azd up, not just azd deploy, if the new model deployment needs to be provisioned. If the model deployment already exists in your Foundry project, azd deploy is sufficient.
Configure different models per environment
You can configure different models for development and production using azd environments:.azure/<env-name>/.env.
Related content
- Azure YAML reference for deployment configuration details.
- Deploy a hosted agent to understand how deployment works.