Skip to content

[Issue] [azure.ai.agents] azd deploy uses agent.yaml name for deployment but polls by services: key in azure.yaml, causing agent deploy timeout when they differ #8559

@shigeyf

Description

@shigeyf
  • Make sure you've installed the latest version using instructions

Output from azd version

azd version 1.25.4 (commit 67d976f0dd7a0cad46e6170fc1e4221a43a8a5db) (stable)
ID                         VERSION          STATUS   SOURCE
───────────────────────────────────────────────────────────
azure.ai.agents            0.1.38-preview   ✓        azd
azure.ai.connections       0.1.1-preview    ✓        azd
azure.ai.finetune          Not installed    -        azd
azure.ai.inspector         0.0.1-preview    ✓        azd
azure.ai.models            Not installed    -        azd
azure.ai.projects          0.1.0-preview    ✓        azd
azure.ai.routines          0.1.0-preview    ✓        azd
azure.ai.skills            0.1.1-preview    ✓        azd
azure.ai.toolboxes         0.1.0-preview    ✓        azd
azure.appservice           Not installed    -        azd
azure.coding-agent         Not installed    -        azd
microsoft.azd.concurx      Not installed    -        azd
microsoft.azd.demo         Not installed    -        azd
microsoft.azd.extensions   Not installed    -        azd
microsoft.foundry          0.1.0-preview    ✓        azd

Describe the bug
When agent.yaml's name differs from the services: key in azure.yaml,
azd deploy behaves inconsistently:

  • The agent is deployed using the name from agent.yaml (correct behavior)
  • Post-deploy polling uses the services: key name from azure.yaml (wrong)

As a result, polling fails to find the deployed agent and times out, even though
the agent was successfully created under the agent.yaml name.

The binary contains the string
"agent name in %s (%q) differs from environment (%q)", confirming the mismatch
is detected but never automatically resolved.

To Reproduce

  1. Create azure.yaml with a service entry key my-agent-name:
    services:
      my-agent-name:
        project: src/agent
        host: azure.ai.agent
        language: docker
  2. Set name: my-different-agent-name in src/agent/agent.yaml
  3. Run azd deploy
  4. Observe: the agent my-different-agent-name is created in Foundry, but polling
    times out because it looks for my-agent-name (the services: key)
ERROR: failed invoking event handlers for 'postdeploy', failed to fetch agent version for my-agent-name/1: GET https://`cognitive_account_name`.services.ai.azure.com/api/projects/`project_name`/agents/my-agent-name/versions/1
--------------------------------------------------------------------------------
RESPONSE 404: 404 Not Found
ERROR CODE: not_found
--------------------------------------------------------------------------------
{
  "error": {
    "code": "not_found",
    "message": "Agent my-agent-name with version 1 not found [Request ID: xxxxx]",
    "type": "error",
    "details": [],
    "additionalInfo": {
      "request_id": "xxxxx"
    }
  }
}
--------------------------------------------------------------------------------

Expected behavior
Both deployment and post-deploy polling use the name from agent.yaml.
The extension should read name from the agent.yaml in the directory
specified by services.<key>.project and use it consistently for both steps.

Environment

  • Language: Python 3.12 / Docker (linux/amd64)
  • OS: Linux (devcontainer)
  • IDE: VS Code

Additional context
Workaround: keep agent.yaml's name: identical to the services: key in
azure.yaml. This constraint is undocumented and non-obvious.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions