Items marked preview in this article are currently in preview. This preview is provided without a service-level agreement, and Microsoft doesn’t recommend it for production workloads. Certain features might not be supported or might have constrained capabilities. For more information, see Supplemental Terms of Use for Microsoft Azure Previews.
azure.yaml file is the single Azure Developer CLI (azd) project configuration for a hosted agent project. It declares your Foundry resources — the project, model deployments, connections, toolboxes, skills, routines, and the agents themselves — as a set of services, and it tells azd how to provision and deploy them. This unified file replaces the earlier two-file model that split configuration between agent.manifest.yaml and agent.yaml.
To learn how to compose and author this file step by step, see Author azure.yaml for hosted agents.
How azd uses azure.yaml
The Azure Developer CLI streamlines the developer-to-cloud workflow. It handles two things: provisioning Azure resources, such as Foundry projects, model deployments, and container registries; and deploying your code to those resources. For hosted agents, theazure.ai.agents extension adds agent-specific commands such as azd ai agent init and azd ai agent run.
Every azd project has an azure.yaml file at its root. For agent projects, this file is the source of truth for both the agent configuration and the deployment configuration.
Environments
An environment is a named configuration, such asdev, staging, or prod, that stores settings for a particular deployment. Each environment tracks the Azure subscription and location, the resource group and resource names, and any custom variables you set. Settings are stored locally in .azure/<env-name>/.env. You can have multiple environments for the same project.
Core commands
Extension compatibility
Theazure.ai.agents extension provides the azure.ai.agent host. The
azure.ai.projects extension provides the azure.ai.project host and the
microsoft.foundry infrastructure provider. Use azure.ai.agents version
1.0.0-beta.8 or later with azure.ai.projects version 1.0.0-beta.4 or
later. For installation and upgrade instructions, see Install the Azure
Developer CLI Foundry extensions.
Public-preview voice services require Azure Developer CLI version 1.32.0 or later and an agent extension that exposes the voice CLI options. The general minimum versions below don’t establish voice feature support. Check the voice agent prerequisites.
You can declare the minimum compatible versions in azure.yaml:
Service provider lifecycle
Install themicrosoft.foundry meta-package when your project includes
connections, toolboxes, skills, or routines. It installs the provider
extensions that implement the corresponding azure.ai.* hosts.
The project and connection providers apply their configuration during
azd provision. The agent, toolbox, skill, and routine providers apply their
configuration during azd deploy. Run azd up to complete both phases.
Removing a data-plane service from azure.yaml stops azd from managing it;
delete the remote resource separately when you no longer need it.
azd down- Deletes the resource group when the current environment created the Foundry project. Leaves an existing project and its resources in place. |azd env set- Sets an environment variable, for exampleazd env set FOUNDRY_MODEL_NAME=gpt-5.4-mini. |
The split-service model
Underservices, each entry is a named service with a host field that identifies the kind of Foundry resource it declares. Services reference each other through the uses field, which forms a dependency graph that azd resolves at provision and deploy time. A typical project has one azure.ai.project service that owns the model deployments and one azure.ai.agent service that depends on it.
Minimal example
Full example
The following project adds a connection, a toolbox, and private networking.Top-level fields
azure.ai.project service
The project service provisions or connects to a Foundry project and owns its model deployments.deployments
A deployment entry can also be an external file include:
- $ref: ./deployments/embeddings.yaml.
network
Setnetwork to provision a network-secured account. The peSubnet field is required and establishes the account private endpoint. Add agentSubnet to inject the agent runtime into your own subnet (bring your own virtual network), or omit it to use the Microsoft-managed network. For a complete walkthrough, see Hosted agent private networking.
Private-network configuration
Usenetwork on the azure.ai.project service to configure the account
private endpoint and agent egress. The following example uses a customer-managed
subnet for the agent runtime:
Private networking disables public data-plane access for the account. An
automatically created Azure Container Registry isn’t supported with this
configuration. Use source-code deployment or specify a prebuilt
image.
azure.ai.agent service
The agent service carries the agent definition and its build and deploy settings. It’s the service that replaces the oldagent.yaml.
Voice services
Usekind: voice for a declarative voice service. The CLI also accepts kind: prompt-voice and continues to generate that alias during prompt voice initialization. Voice services use the same azure.ai.agent host as hosted and prompt agents.
For model and audio examples, see Configure a voice agent.
Hosted conversation engine
Set these fields on the voice wrapper, not on the hosted target:
Include the hosted target in the wrapper’s
uses list to order deployment. The target must be active and declare invocations_ws version 1.0.0, with voiceLiveCompatible: "true" and bridgeProtocolVersion: "1.0" metadata.
Model calls, instructions, and tools belong to the target. Audio and greeting settings belong to the wrapper. The older modelType: hosted_agent and targetAgent settings aren’t supported; use conversationEngine.
For the complete two-service sample, see Use a hosted agent as the conversation engine in a voice-based agent.
Telephony bindings
Each entry intelephony.bindings requires provider, identifier, and connection. connection is the name of an existing Foundry project connection, not a provider credential.
The CLI maps
acs to the service provider value azure-communication-service. Use these identifiers in azure.yaml; don’t copy them into REST properties that expect a different representation.
Bindings are create-only. Deployment accepts a matching existing binding but fails if its configuration differs. Provider-side callbacks and phone resources aren’t created by this declaration. For an example and lifecycle guidance, see Add a telephony binding.
agentCard.skills and azure.ai.skill
agentCard.skills describes an agent’s capabilities in its discovery card.
It provides metadata for clients and doesn’t create or attach a reusable
Foundry skill. Each card skill requires an id, name, and description.
An azure.ai.skill service creates a versioned skill from instructions and
optional allowed tools. Declare it separately under services; its uses
list controls dependency order, but it doesn’t populate agentCard.skills or
attach the skill to an agent. Use agentCard.skills for discovery metadata and
azure.ai.skill for reusable instructions.
Complete a discovery card
Addversion, tags, and examples when clients need richer discovery
metadata. A card requires a description and at least one skill. Each skill
requires an id, name, and description.
Responsible AI policies
Usepolicies to associate a Responsible AI policy with the hosted agent.
Set raiPolicyName to the full ARM resource ID of the policy:
rai_policy type and raiPolicyName are required. The extension applies
the first valid policy in the list to the hosted-agent Responsible AI
configuration. For policy creation and management guidance, see Add guardrails
to hosted agents.
Memory stores
UsememoryStores to create or reuse Foundry memory stores before deployment.
Each store requires existing chat-model and embedding-model deployment names.
Existing stores aren’t updated during deployment. If the declared definition
differs from the existing store,
azd reports the difference. Declaring a
memory store doesn’t change your agent code or automatically attach a memory
tool. Connect your application to the memory store by using the memory search
tool or memory store APIs. For details, see Use memory with agents.
Configure an agent endpoint
UseagentEndpoint to configure the protocols and authorization schemes
published by the agent endpoint. Use an agent card with an A2A endpoint so
other agents can discover the capabilities you expose.
versionSelector.versionSelectionRules when you need to
control which agent version receives endpoint traffic. Agent Service validates
endpoint protocol and authorization values during deployment.
protocols
For the full protocol specification, see Hosted agent runtime contract.
Additional runtime protocols and Activity endpoints
In addition toresponses, invocations, and a2a, hosted agents support
invocations_ws for WebSocket invocations and activity for Microsoft 365 and
Teams activity scenarios.
activity to the public endpoint configuration and
use the required Bot Service authorization scheme:
env
${ } syntax references azd environment variables from .azure/<env>/.env.
Don’t declare
FOUNDRY_PROJECT_ENDPOINT in env. The platform injects it automatically into hosted containers, and azd ai agent run sets it for local development. Declaring it here is redundant and risks shadowing the platform value.Platform environment, identity, and endpoints
The platform reserves theFOUNDRY_ and AGENT_ prefixes. Read platform
variables, such as FOUNDRY_PROJECT_ENDPOINT, from your application code, but
don’t define or override them in env. Agent-defined environment values are
strings.
Each deployed hosted agent receives a dedicated Microsoft Entra ID agent
identity and endpoint. Don’t add an identity block to the agent service.
The agent identity can use the project endpoint and session storage by default.
Assign the identity additional roles when the agent needs to access external
resources. For details, see Hosted agent permissions reference.
The protocols you declare determine the endpoints that are active after
deployment. Run azd ai agent show to inspect the deployed agent and its
endpoint URLs.
After deployment, azd writes the following values to the active environment,
using the normalized service name in place of <SERVICE>:
AGENT_<SERVICE>_NAMEAGENT_<SERVICE>_VERSIONAGENT_<SERVICE>_ENDPOINTAGENT_<SERVICE>_<PROTOCOL>_ENDPOINTfor enabledresponses,invocations, andinvocations_wsprotocols
container
cpu from "0.25" up to "4.0", and memory from 0.5Gi up to 8.0Gi.
Source-code deployment
SetcodeConfiguration to deploy source code as a ZIP instead of a container
image. Specify one entry-point filename or assembly name. azd combines it
with the selected runtime when it creates the hosted-agent version.
remote_build to restore dependencies from the project sources, or use
bundled when the ZIP contains Linux-compatible dependencies. Don’t combine
codeConfiguration with image-based container configuration. For packaging and
dependency guidance, see Deploy a hosted agent from source code.
Container builds and prebuilt images
Use aDockerfile under project to build a container image, or set image
to deploy a prebuilt image:
Dockerfile and an image are both available, choose the prebuilt image
in the interactive deployment prompt. For unattended deployment, set
AZD_AGENT_SKIP_ACR to true in the active azd environment to select the
configured image. For registry permissions and private registry deployment,
see Deploy a hosted agent with a private Azure Container Registry.
Metadata and schema limitations
Use string values for deployed agent metadata. Theauthors metadata value can
be a list of strings. Don’t rely on displayName, inputSchema, or
outputSchema to configure the deployed hosted agent; the unified
configuration accepts these fields, but the hosted-agent create request doesn’t
use them.
azure.ai.connection service
A connection links the project to an external resource. The service key is the connection name, and the service depends on the project throughuses.
azd provision, not azd deploy. Store
credential values in your azd environment and reference them with ${VAR}
instead of putting secrets in azure.yaml.
azure.ai.toolbox service
A toolbox is a named bundle of tools that agents reference. Connection-backed tools name anazure.ai.connection service through the connection field.
uses and its toolboxes list.
Consume a toolbox endpoint
In a split-service project,uses controls deployment order. Your application
connects to the toolbox’s MCP endpoint at runtime. Pass the toolbox name or
endpoint to your application through env, then construct the consumer endpoint
from FOUNDRY_PROJECT_ENDPOINT in your agent code. For an end-to-end example,
see Use a toolbox with a hosted agent.
azure.ai.skill and azure.ai.routine services
Aazure.ai.skill service defines a reusable behavioral guideline that agents reference by name. A azure.ai.routine service defines a trigger (schedule or event) and an action that invokes an agent. Both depend on the resources they use through uses. To learn more about adding tools for agent use, see What is Toolbox in Foundry? and Use routines.
Skills and routines are separate resources. Declaring either service controls
its lifecycle but doesn’t automatically attach a skill to the agent or infer a
routine action target. Configure the consuming application or routine action
explicitly.
Dependencies with uses
Theuses field declares the services a given service depends on. azd uses this graph to order provisioning and to wire references, such as an agent’s connections and toolboxes.
File includes with $ref
Any service or list entry can be replaced with a reference to an external YAML or JSON file. Relative paths resolve from the file that contains the$ref. Remote URLs aren’t supported.
azure.yaml entry when you use a service
$ref: host, uses, project, language, image, and docker. Put
provider-owned definition fields, such as kind, name, description, and
protocols, in the referenced mapping. $ref resolves local YAML or JSON
files recursively; URLs and reference cycles aren’t supported.
Variable substitution
Two substitution syntaxes can appear inazure.yaml:
Infrastructure and deploy modes
Bicep-less by default
azd ai agent init is bicep-less by default: it doesn’t write an infra/ directory, and azd synthesizes the infrastructure from your azure.yaml services at provision time. To materialize infrastructure-as-code files, eject them:
When
infra is present in azure.yaml, azd uses those files instead of synthesizing infrastructure.
Deploy modes
A hosted agent deploys in one of two modes:
For source deploys, the
codeConfiguration field on the agent service captures the runtime and entry point. For prebuilt images, set the image field on the agent service and skip the Dockerfile build.
Legacy configuration migration
Older agent definitions can nest environment variables underconfig: env.
In the unified azure.yaml, move the env mapping to the agent service: