You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> If you already ran `azd provision`, extract these from `azd env get-values`.
11
+
>
12
+
> **Critical: keep `.env` and `azd env` in sync.** `azd ai agent run` injects the active `azd env` values into the agent process before Python loads `.env`. Many samples use `load_dotenv(override=False)`, so an existing process environment value wins over `.env`. If you change the project endpoint or model deployment, update both `.env` and `azd env`:
13
+
> ```bash
14
+
> azd env set FOUNDRY_PROJECT_ENDPOINT "https://<account>.services.ai.azure.com/api/projects/<project>"
15
+
> azd env set AZURE_AI_MODEL_DEPLOYMENT_NAME "<model-deployment-name>"
16
+
> azd env get-values
17
+
> ```
18
+
> A stale `AZURE_AI_MODEL_DEPLOYMENT_NAME` in `azd env` can make local run call the wrong deployment even when `.env` is correct, commonly surfacing as a Foundry responses API `404 Not Found`.
11
19
12
20
## Start the agent locally
13
21
@@ -19,7 +27,7 @@ What this does:
19
27
20
28
1. Resolves the agent service from `azure.yaml` (auto-picks when only one exists).
21
29
2. Detects the project type (Python, .NET, Node.js) from files in the service source dir.
Copy file name to clipboardExpand all lines: plugin/skills/microsoft-foundry/foundry-agent/deploy/deploy.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -164,7 +164,7 @@ azd deploy --no-prompt
164
164
165
165
Each env has its own `AGENT_<SVC>_*` vars.
166
166
167
-
## Common failure modes -- Hosted
167
+
## Common failure -- Hosted
168
168
169
169
| Error | Fix |
170
170
|-------|-----|
@@ -176,6 +176,7 @@ Each env has its own `AGENT_<SVC>_*` vars.
176
176
| `container registry endpoint not found` | ACR not configured. Use `azd env set AZURE_CONTAINER_REGISTRY_ENDPOINT <url>`, or switch to direct code deployment. |
177
177
| Agent version poll times out | Image still building; retry `azd ai agent show` after a minute. |
178
178
| `session_not_ready` (424) | Cold start — wait 30-60 seconds and retry. For direct code deployments, first invocation installs dependencies. Use `1` CPU / `2Gi` memory minimum. **Also verify:** (1) a capability host exists on the Foundry account (see Step 2 above), (2) the agent's managed identity has `Cognitive Services User` role on the Foundry account — missing capability host or role are the most common causes of persistent `session_not_ready`. See [direct-code-deployment Task 8-9](references/direct-code-deployment.md) and [invoke](../invoke/invoke.md). |
179
+
|`could not resolve agent service in azd project: no azure.ai.agent service named '<agentName>' found in azure.yaml` from `azd ai agent invoke`| Name mismatch. Update the agent name to the deployed agent name. |
179
180
|`subscription quota exceeded`| Ask user to request quota; don't auto-retry. |
180
181
| Bicep deploy errors | Forward `error.details[]` verbatim to the user. |
181
182
| `RoleAssignmentUpdateNotPermitted` during provision | A role assignment already exists but conflicts. Check for existing role assignments with `az role assignment list --scope <resource-scope>`. The provision may have succeeded for all resources except RBAC — verify with `azd ai project show` and manually assign the `Cognitive Services User` role to the agent identity if needed. |
Copy file name to clipboardExpand all lines: plugin/skills/microsoft-foundry/foundry-agent/deploy/references/direct-code-deployment.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -315,6 +315,8 @@ Do not send `x-ms-agent-name` on `POST /agents/<agent-name>/versions` or `POST /
315
315
316
316
Update agent and create version are idempotent on zip SHA-256 plus agent definition. If both are unchanged from the latest version, the service can return the existing version instead of creating a duplicate. To force a new version, change the zip contents or definition.
317
317
318
+
If the write response contains `versions.latest`, use `versions.latest.version`, `versions.latest.status`, and `versions.latest.instance_identity.principal_id`. Do not poll `/versions/None`; if no version can be extracted, list versions first and pick the newest returned version.
Copy file name to clipboardExpand all lines: plugin/skills/microsoft-foundry/foundry-agent/invoke/invoke.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -120,6 +120,7 @@ Use `session_delete` to release compute resources when done. Undeleted sessions
120
120
| Hosted agent not active | Version still provisioning or failed | Check version status via `agent_get`|
121
121
| Session not found | Invalid ID or expired | Create new session with `session_create`|
122
122
|`424 FailedDependency` or `session_not_ready`| Hosted agent session is still warming up or readiness has not completed | Wait 15-30 seconds, check `session_logstream` if needed, then retry `agent_invoke` with the same `sessionId` if one was returned; if no `sessionId` was returned, retry `session_create`. If this persists across 3+ retries (with exponential backoff: 15s, 30s, 60s), the container likely cannot start within the readiness probe deadline — redeploy with higher CPU/memory (recommended minimum: `1` CPU / `2Gi` for direct-code deployments). Also verify the model deployment name is correct via `model_deployment_get`. |
123
+
|`could not resolve agent service in azd project: no azure.ai.agent service named '<agentName>' found in azure.yaml` from `azd ai agent invoke`| Name mismatch. | Update the agent name to the deployed agent name. |
123
124
| Invocation failed | Model error, timeout, or invalid input | Check agent logs, verify model deployment |
124
125
| Invocations schema mismatch | Request body does not match what the agent expects | Inspect agent's route handler or API docs for the correct JSON schema; do not guess |
125
126
| File operation failed | Session not active or invalid path | Verify session with `session_get`|
0 commit comments