Skip to content

azure.ai.agents: remote invoke failed when init a manifest with existing Foundry project #9109

Description

@ChenxiJiang333

Description:
In a scenario to re-run samples against an existing project, azd ai agent invoke failed for not recognize the agent service, though it has already been defined in azure.yaml.
Image

yaml content:

requiredVersions:
    extensions:
        azure.ai.agents: '>=1.0.0-beta.4'
name: hello-world-python-invocations
services:
    ai-project:
        host: azure.ai.project
        deployments: []
        endpoint: https://cog-akuze6i4da7lm.services.ai.azure.com/api/projects/hello-world-python-invocations-d
    hello-world-python-invocations:
        project: src/hello-world-python-invocations
        host: azure.ai.agent
        language: python
        uses:
            - ai-project
        codeConfiguration:
            entryPoint: main.py
            runtime: python_3_13
        container:
            resources:
                cpu: "0.5"
                memory: 1Gi
        description: Minimal Hello World agent using the Invocations protocol with a bring-your-own approach. Calls a Foundry model via the Responses API and returns the response as a streaming SSE event stream.
        displayName: Hello World (Python, Invocations)
        environmentVariables:
            - name: AZURE_AI_MODEL_DEPLOYMENT_NAME
              value: ${AZURE_AI_MODEL_DEPLOYMENT_NAME}
        kind: hosted
        metadata:
            tags:
                - AI Agent Hosting
                - Invocations Protocol
                - Bring Your Own
                - Python
        name: hello-world-python-invocations
        protocols:
            - protocol: invocations
              version: 2.0.0
infra:
    provider: microsoft.foundry

Steps to Reproduce:

  1. Run azd ai agent init --manifest "https://github.com/microsoft-foundry/foundry-samples/blob/main/samples/python/hosted-agents/bring-your-own/invocations/hello-world/azure.yaml" --project-id "/subscriptions/<SUBSCRIPTION_ID>/resourceGroups/<RESOURCE_GROUP>/providers/Microsoft.CognitiveServices/accounts/<ACCOUNT_NAME>/projects/<PROJECT_NAME>" --model-deployment "<MODEL_DEPLOYMENT_NAME>".
  2. Run azd ai agent invoke --protocol invocations '{"message": "hello existing project hosted"}'.

Environment:

  • Azd version: azd version azd version 1.27.1-daily.6542240 (commit a76daf4) (daily)
  • AI Agent Extension version: 1.0.0-beta.5
  • OS: Windows
  • Location: northcentralus.

Expected Behavior:
Remote invoke can succeed.

@JeffreyCA and @RickWinter for notification.

Metadata

Metadata

Assignees

No one assigned

    Labels

    ext-agentsazure.ai.agents extension

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions