Loading source
Pulling the file list, source metadata, and syntax-aware rendering for this listing.
Source from repo
Build and deploy AI applications on Azure AI Foundry using Microsoft's model catalog and AI services
Files
Skill
Size
Entrypoint
Format
Open file
Syntax-highlighted preview of this file as included in the skill package.
foundry-agent/observe/references/deploy-and-setup.md
1# Step 1 - Auto-Setup Evaluation Suite23> **This step runs automatically after deployment.** If the agent was deployed via the [deploy skill](../../deploy/deploy.md), `.foundry` cache and metadata may already be configured. Check `.foundry/evaluators/`, `.foundry/datasets/`, and the selected metadata file under the selected agent root before re-creating them.45## Auto-Generate Suite67After deployment, immediately prepare a Foundry evaluation suite and local references for the selected environment without waiting for the user to request it.89### 1. Resolve Context1011Use [Common Project Context Resolution](../../../SKILL.md#agent-common-project-context-resolution) to compute effective context. In azd projects, prefer `azd env get-values` for deployment context and use the selected `.foundry/agent-metadata*.yaml` file only as an overlay/cache. Use `agent_get`, local `agent.yaml`, and matching `eval.yaml` as needed to resolve:1213| Value | Source |14|-------|--------|15| `projectEndpoint` | azd env, then metadata override |16| `agentName` / `agentVersion` | azd agent vars, then metadata/`agent_get` |17| `suiteName` | verified `eval.yaml` name or `<agent-name>-smoke` unless user provided one |18| generation deployment | `model_deployment_get`; choose a chat-completions deployment |1920`suiteName` must start with a letter (`A-Z` or `a-z`). If a derived name starts with a number, prefix it with an alphabetic label such as `suite-`.2122Do not assume `gpt-4o` exists.2324### 2. Reuse or Refresh Cache2526Inspect `.foundry/suites/`, `.foundry/evaluators/`, `.foundry/datasets/`, matching `eval.yaml`, and the selected environment's `evaluationSuites[]` in the selected agent root only. Do **not** merge sibling agent folders.2728- **Suite metadata has `suiteName` and current cache** -> call `evaluation_suite_get` to verify the remote suite, then reuse it.29- **`eval.yaml` exists and matches the selected agent** -> verify its `dataset.local_uri` or registered `dataset.name`/`dataset.version`, `evaluators[]`, and optional `name` remotely or register them before persisting a synced suite entry. Normalize legacy `dataset_file` in memory only.30- **Cache is missing/stale or user asks refresh** -> generate a new suite after confirming any overwrite.31- **Legacy entry without `suiteName`** -> keep it as legacy fallback metadata unless the user approves generating a new suite.3233### 3. Generate Suite3435Read [Evaluation Suite Generation](evaluation-suite-generation.md). If the user selected existing `eval.yaml`, follow the local eval.yaml verification/registration path there before creating a generated suite. Otherwise call:3637```text38evaluation_suite_generation_job_create(39projectEndpoint,40suiteName,41agentName,42generationModelDeploymentName,43dataGenerationType,44maxSamples45)46```4748For trace-informed suites, include `traceAgentName` or `traceAgentId`, `traceAgentVersion`, `traceStartTime`, `traceEndTime`, and `maxTraces`. Start background polling with `evaluation_suite_generation_job_get`, suppress intermediate `in_progress` output, then verify the generated suite with `evaluation_suite_get` after terminal success.4950When refining an existing dataset, include `datasetName` and `datasetVersion`.5152### 4. Persist Local References5354Cache generated artifacts inside the selected root:5556```text57.foundry/58agent-metadata.yaml59agent-metadata.prod.yaml60suites/<suite-name>-v<version>.json61evaluators/<evaluator-name>-v<version>.json62datasets/<agent-name>-<dataset-name>-v<version>.ref.json63datasets/<dataset-name>-v<version>/<blob-name>64results/65```6667If the job result exposes only remote names/versions, fetch metadata with `evaluation_suite_get(projectEndpoint, suiteName, suiteVersion)`, `evaluation_dataset_get`, `evaluation_dataset_sas_url_get`, and `evaluator_catalog_get`, then materialize the full suite JSON, full evaluator JSON, dataset `.ref.json`, and downloaded dataset blobs. Never overwrite user-edited cache files without confirmation; deterministic re-fetch of the same immutable remote `<name>-v<version>` may replace the generated cache artifact for that exact version.6869### 5. Update Metadata7071Write only the selected metadata file and selected environment. In azd projects, persist only non-derivable overlay/cache state; do not copy azd-owned project endpoint, agent name/version, ACR, or observability values. Persist evaluation suites with:7273- `id`, `tags`, `suiteName`, `suiteVersion`74- `generationJobId`, `generationSource` (`synthetic`, `traces`, or `manual-fallback`)75- `dataset`, `datasetVersion`, `datasetFile`, `datasetUri`76- evaluator `name`, `version`, `threshold`, `definitionFile` (full cached JSON)7778Use tags such as `tier: smoke`, `purpose: baseline`, and `stage: generated`. If metadata still uses older `testSuites[]` or legacy `testCases[]`, replace that list with `evaluationSuites[]` on write and map `priority` to `tags.tier` only when `tags.tier` is missing.7980### 6. Fallback8182If suite generation fails, is unavailable, or returns incomplete artifacts, explain the failure and fall back to the existing manual path: `evaluator_catalog_get`, local seed JSONL generation via [Generate Seed Evaluation Dataset](../../eval-datasets/references/generate-seed-dataset.md), `evaluation_dataset_create`, and `evaluationSuites[]` metadata with `generationSource: manual-fallback`.8384### 7. Prompt User8586Ask: *"Your agent is deployed and the selected environment has evaluation-suite metadata plus local dataset/evaluator references. Would you like to run an evaluation to identify optimization opportunities?"*8788If yes -> proceed to [Step 2: Evaluate](evaluate-step.md). If no -> stop.89