Skip to content

Add native A2A echo hosted-agent sample - #1066

Open
Hameed Kunkanoor (Hameedkunkanoor) wants to merge 1 commit into
microsoft-foundry:mainfrom
Hameedkunkanoor:feature/a2a-echo-sample
Open

Hameed Kunkanoor (Hameedkunkanoor) wants to merge 1 commit into
microsoft-foundry:mainfrom
Hameedkunkanoor:feature/a2a-echo-sample

Conversation

@Hameedkunkanoor

Copy link
Copy Markdown
Contributor

Summary

Adds a minimal native A2A v1 echo agent to the Python Bring Your Own hosted-agent samples.

The sample demonstrates:

  • native a2a-sdk Agent Card, JSON-RPC, Task, artifact, and executor behavior;
  • hosting through azure-ai-agentserver-a2a on Foundry's canonical A2A routes;
  • direct code deployment with azd;
  • a dedicated native A2A client for local and hosted validation;
  • exact runtime dependency pins and repository index integration.

Dependency

This PR depends on Azure/azure-sdk-for-python#49491 and publication of azure-ai-agentserver-a2a==1.0.0b1 to PyPI. Until publication, the repository's --resolve dependency policy check is expected to report PYREQ012; the committed artifact intentionally uses the final public package pin rather than a nonportable local wheel.

The sample is listed in the hosted-agent cloud CI skip list because the shared runner currently supports only Responses and Invocations. A2A requires Agent Card discovery plus JSON-RPC Task handling, which the sample's dedicated test_client.py provides.

Validation

  • Python compilation — passed
  • Local /readiness probe — passed
  • Native A2A Agent Card discovery and JSON-RPC echo — passed (Echo: hello from sample validation)
  • Hosted-agent dependency policy, static validation — passed
  • Hosted-agent contract policy — passed
  • git diff --check — passed
  • Dependency resolution — expected PYREQ012 until azure-ai-agentserver-a2a==1.0.0b1 is published

Related PR

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 12, 2026 14:43
@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines:
There may be pipelines that require an authorized user to comment /azp run to run.

@Hameedkunkanoor

Copy link
Copy Markdown
Contributor Author

Hosted A2A end-to-end validation passed on 2026-10-12.

Validated against an active Foundry hosted-agent version:

  1. azd ai agent show reported the hosted version as active with protocol a2a version 1.0.0.
  2. The dedicated native client authenticated with AzureCliCredential.
  3. The client discovered the public Agent Card through agentCard/v1.0.
  4. It sent an A2A v1 SendMessageRequest over the public Foundry endpoint.
  5. The container created/completed an A2A Task and returned an artifact.
  6. The client asserted the exact artifact text and printed: Echo: hosted A2A validation 2026-10-12.

This validates the full Foundry authentication, public A2A routing, container hosting, native SDK request handling, and response artifact path—not only local ASGI behavior.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The sample depends on an unpublished package, omits required uv artifacts, and presents a hosted path that is not yet service-enabled.

3 open findings
What changed in this PR

Adds a native A2A v1 echo agent to the Python Bring Your Own hosted-agent samples.

Changes:

  • Implements the A2A echo server and validation client.
  • Adds deployment, dependency, and usage documentation.
  • Registers the sample while excluding unsupported cloud CI execution.
File Description
.azure-pipelines/​scripts/​hosted-agent-samples-ci-skiplist Excludes A2A from generic cloud CI.
samples/​python/​hosted-agents/​README.md Adds A2A to the sample index.
.../​echo/​AGENTS.md Documents contributor workflows.
.../​echo/​CLAUDE.md Redirects instructions to AGENTS.md.
.../​echo/​README.md Documents setup, deployment, and validation.
.../​echo/​azure.yaml Defines the hosted A2A deployment.
.../​echo/​src/​echo-a2a/​.agentignore Excludes local Python artifacts.
.../​echo/​src/​echo-a2a/​.azdignore Excludes local deployment artifacts.
.../​echo/​src/​echo-a2a/​.gitignore Excludes generated local files.
.../​echo/​src/​echo-a2a/​main.py Implements the native echo executor and host.
.../​echo/​src/​echo-a2a/​requirements.txt Pins runtime dependencies.
.../​echo/​src/​echo-a2a/​test_client.py Adds local and hosted A2A validation.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

$endpoint = "$projectEndpoint/agents/echo-a2a/endpoint/protocols/a2a"
```

Run the dedicated hosted E2E client:
Comment on lines +1 to +2
# This file was autogenerated by uv via the following command:
# uv export --frozen --no-dev --no-emit-project --format requirements-txt --no-hashes --output-file requirements.txt
| **SDK** | `agent-framework-foundry-hosting` (includes core, openai, foundry, orchestrations) | `langchain-azure-ai[hosting]` (`ResponsesHostServer` / `InvocationsHostServer`) | `azure-ai-agentserver-responses` / `azure-ai-agentserver-invocations` / `azure-ai-agentserver-a2a`, or `azure-ai-agentserver-core` for fully custom HTTP |
| **Foundry integration** | Native — sessions, tools, memory, streaming all built in | Native via `langchain_azure_ai.agents.hosting` — sessions, streaming, and tool-call surfacing built in for LangGraph agents (`create_agent`) and custom `StateGraph`s | Core adapter hosts the web server and exposes `/invocations` and `/responses` endpoints; you supply the agent logic |
| **Protocols** | Responses and Invocations | Responses and Invocations | Responses and Invocations |
| **Protocols** | Responses and Invocations | Responses and Invocations | Responses, Invocations, and A2A |

This branch was successfully deployed

1 active deployment
L4-validation — 05030b15 Deployed Oct 12, 2026 by Hameedkunkanoor via trusted #503
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants