The Azure Developer CLI evaluation experience is currently in preview.
azd), the Microsoft Foundry portal, and the Python SDK.
Evaluation establishes a quality baseline for your agent and lets you set acceptance thresholds, such as a task adherence passing rate, before you release changes to users.
Prerequisites
Before you begin, you need:- A deployed, invokable hosted agent from Deploy your first hosted agent. For the Azure Developer CLI path, you also need the
azdproject directory you created in that quickstart. - The Foundry User role on the Foundry resource.
- A chat-completion model deployment in the same Foundry project to use as the judge model that scores responses. You can reuse the model deployment your agent already uses, including the one from the previous quickstart, so you don’t need a separate deployment.
The Foundry RBAC roles were recently renamed. Foundry User, Foundry Owner, Foundry Account Owner, and Foundry Project Manager were previously named Azure AI User, Azure AI Owner, Azure AI Account Owner, and Azure AI Project Manager. You might still see the previous names in some places while the rename rolls out. The role IDs and core permissions are unchanged by the rename.Each step offers three paths. Use whichever you prefer:
- Azure Developer CLI: The
azd ai agentextension (azure.ai.agents), version 0.1.40-preview or later, which provides theazd ai agent evalcommands. This extension is included in themicrosoft.foundryextension you installed in the previous quickstart. Verify the installed version withazd ext list, and runazd ext upgrade microsoft.foundryif needed. Sign in withazd auth login. - Foundry portal: Access to the Foundry portal.
- Python SDK: Python 3.9 or later, and the Azure CLI signed in with
az loginso thatDefaultAzureCredentialcan authenticate. For installation, see Install the Azure CLI.
Step 1: Confirm your deployed agent
Evaluation runs against a deployed, invokable agent. Confirm your agent is deployed and available before you set up the evaluation.- Azure Developer CLI
- Foundry portal
- Python SDK
From your Send a test prompt:You should see a response within a few seconds.
azd project directory, verify the agent is deployed and invokable:Step 2: Set up built-in evaluators
Start with built-in evaluators to score your agent against a test dataset.- Azure Developer CLI
- Foundry portal
- Python SDK
First, create a JSONL file of test queries for your agent. Each line is a JSON object with a Then create an The
query field. Save it inside your agent’s source folder, as src/<your-agent-name>/tests/queries.jsonl:eval.yaml file in the same agent source folder, as src/<your-agent-name>/eval.yaml. It points to your dataset and lists the built-in evaluators to apply. The dataset.local_uri path is relative to this folder. Replace <your-agent-name> with your hosted agent’s name and <your-chat-completion-deployment> with the judge model deployment:eval_model value is the judge model that scores responses; you can reuse the deployment your agent already uses.Step 3: Run the evaluation
Run the suite against your deployed agent. The service sends each test query to the agent, captures the response, and scores it with your selected evaluators.Target-based evaluation invokes your hosted agent directly. It works with agents that use the responses or invocations protocol with synchronous, non-streaming execution. To evaluate agents that use the A2A or Activity protocol, or other execution patterns such as long-running or streaming, evaluate the traces your agent emits instead. See Trace evaluation.
- Azure Developer CLI
- Foundry portal
- Python SDK
Run the evaluation from the azd workspace root:The command reads
azd ai agent eval run resolves the --config path relative to your agent’s source folder under src/ (for example, src/<your-agent-name>/eval.yaml), not the current directory. Keep eval.yaml, and the dataset that its local_uri points to, inside that folder.eval.yaml, sends each query to your agent, scores the responses, and prints a summary when it finishes:Step 4: Review the results
Evaluations typically complete in a few minutes, depending on the number of queries.- Azure Developer CLI
- Foundry portal
- Python SDK
List recent evaluations:Show the most recent evaluation and its runs:Use the results to confirm which agent version was evaluated and which evaluator scores were produced. To see per-evaluator details and a link to the report in the Foundry portal, run
azd ai agent eval show <eval-id> --eval-run-id <run-id>.Clean up resources
This quickstart registers a dataset, an evaluation, and run history in your Foundry project. These assets incur little or no ongoing cost. To remove the hosted agent and the Azure resources you created, follow the cleanup steps in Deploy your first hosted agent.Troubleshooting
What you learned
In this quickstart, you:- Created a test dataset and chose evaluators for your hosted agent.
- Ran an evaluation against the deployed agent.
- Reviewed aggregated and row-level results.
- Completed each task with the Azure Developer CLI, the Foundry portal, and the Python SDK.
Next steps
Optimize a hosted agent
- Set up continuous and scheduled evaluations to track your agent’s quality in production.
Related content
- Evaluate your AI agents
- Run batch evaluations from the SDK
- Generate a synthetic evaluation dataset to create test queries and evaluators automatically.
- Troubleshoot evaluation and observability issues
- Agent evaluators reference
- What are hosted agents?


