From 7b28655eadd8b6db9b3cdde7d400681d5932271c Mon Sep 17 00:00:00 2001 From: Darren Cohen <39422044+dargilco@users.noreply.github.com> Date: Wed, 14 Oct 2026 16:09:29 -0700 Subject: [PATCH] First --- .../foundry-hosted-agents/README.md | 10 ++--- .../responses/basic/README.md | 14 +++++-- .../responses/basic/agent.manifest.yaml | 23 ------------ .../responses/basic/agent.yaml | 12 ------ .../responses/basic/azure.yaml | 37 +++++++++++++++++++ 5 files changed, 53 insertions(+), 43 deletions(-) delete mode 100644 python/samples/04-hosting/foundry-hosted-agents/responses/basic/agent.manifest.yaml delete mode 100644 python/samples/04-hosting/foundry-hosted-agents/responses/basic/agent.yaml create mode 100644 python/samples/04-hosting/foundry-hosted-agents/responses/basic/azure.yaml diff --git a/python/samples/04-hosting/foundry-hosted-agents/README.md b/python/samples/04-hosting/foundry-hosted-agents/README.md index 1c91b59bfea..4a36f9b2f0b 100644 --- a/python/samples/04-hosting/foundry-hosted-agents/README.md +++ b/python/samples/04-hosting/foundry-hosted-agents/README.md @@ -2,7 +2,7 @@ This directory contains samples that demonstrate how to use hosted [Agent Framework](https://github.com/microsoft/agent-framework) agents with different capabilities and configurations on Foundry using the Foundry Hosting Agent service. Each sample includes a README with instructions on how to set up, run, and interact with the agent. -> [IMPORTANT] Migrating from Protocol version 1.0.0 to 2.0.0: Foundry Hosting Agents service has been updated to use Protocol version 2.0.0. If your application is using Protocol version 1.0.0, please upgrade to Protocol version 2.0.0 in your `agent.manifest.yaml` or `agent.yaml` and upgrade to the latest `agent-framework-foundry-hosting` package. `agent-framework-foundry-hosting==1.0.0a260625` is the last version that supports Protocol version 1.0.0. +> [IMPORTANT] Migrating from Protocol version 1.0.0 to 2.0.0: Foundry Hosting Agents service has been updated to use Protocol version 2.0.0. If your application is using Protocol version 1.0.0, please upgrade to Protocol version 2.0.0 in `azure.yaml` and upgrade to the latest `agent-framework-foundry-hosting` package. `agent-framework-foundry-hosting==1.0.0a260625` is the last version that supports Protocol version 1.0.0. > > The `agent-framework-foundry-hosting` Python API surface is intended to remain stable, but protocol 1.0.0 and 2.0.0 are incompatible. ## Samples @@ -104,13 +104,13 @@ to workspace, package or sample `pyproject.toml` files. #### Create a new project -**No cloning required**. Create a new folder, point azd at the manifest on GitHub. +**No cloning required**. Create a new folder, point azd at the `azure.yaml` template on GitHub. ```bash mkdir hosted-agent-framework-agent && cd hosted-agent-framework-agent -# Initialize from the manifest -azd ai agent init -m https://github.com/microsoft/agent-framework/blob/main/python/samples/04-hosting/foundry-hosted-agents/responses/basic/agent.manifest.yaml +# Initialize from the azure.yaml template +azd ai agent init -t https://github.com/microsoft/agent-framework/blob/main/python/samples/04-hosting/foundry-hosted-agents/responses/basic/azure.yaml ``` Follow the instructions from `azd ai agent init` to complete the agent initialization. If you don't have an existing Foundry project and a model deployment, `azd ai agent init` will guide you through creating them. @@ -267,7 +267,7 @@ Once you've tested locally, deploy to Microsoft Foundry. If you already have a Foundry project and the necessary Azure resources provisioned, you can skip the setup steps and proceed directly to deploying the agent. -After running `azd ai agent init -m ` and following the prompts to configure your agent, you will have a project ready for deployment. +After running `azd ai agent init -t ` and following the prompts to configure your agent, you will have a project ready for deployment. ### Setting Up a New Foundry Project diff --git a/python/samples/04-hosting/foundry-hosted-agents/responses/basic/README.md b/python/samples/04-hosting/foundry-hosted-agents/responses/basic/README.md index d9b46fcd7f0..c73b5f7b151 100644 --- a/python/samples/04-hosting/foundry-hosted-agents/responses/basic/README.md +++ b/python/samples/04-hosting/foundry-hosted-agents/responses/basic/README.md @@ -21,9 +21,17 @@ whether it uses that provider or downstream service storage; the host does not f stored requests. In none of these cases is the caller's `response.id` the downstream service ID. -Run one entry point at a time. The deployment manifest targets `main.py`; select another script to deploy a different -mode. Set `FOUNDRY_PROJECT_ENDPOINT` and `FOUNDRY_MODEL` in `.env`, then run `python main.py`. -Follow the [parent hosting guide](../../README.md) for local and deployed setup. +Run one entry point at a time. The [`azure.yaml`](azure.yaml) deployment template targets `main.py`; select another +script to deploy a different mode. Set `FOUNDRY_PROJECT_ENDPOINT` and `FOUNDRY_MODEL` in `.env`, then run +`python main.py`. + +To initialize a deployable project from this sample without cloning the repository: + +```bash +azd ai agent init -t https://github.com/microsoft/agent-framework/blob/main/python/samples/04-hosting/foundry-hosted-agents/responses/basic/azure.yaml +``` + +Follow the [parent hosting guide](../../README.md) for the remaining local and deployed setup. ## Outer response storage and background diff --git a/python/samples/04-hosting/foundry-hosted-agents/responses/basic/agent.manifest.yaml b/python/samples/04-hosting/foundry-hosted-agents/responses/basic/agent.manifest.yaml deleted file mode 100644 index 9547802be6a..00000000000 --- a/python/samples/04-hosting/foundry-hosted-agents/responses/basic/agent.manifest.yaml +++ /dev/null @@ -1,23 +0,0 @@ -name: agent-framework-agent-basic-responses -description: > - A basic Agent Framework agent hosted by Foundry. -metadata: - tags: - - Agent Framework - - AI Agent Hosting - - Azure AI AgentServer - - Responses Protocol - - Streaming -template: - name: agent-framework-agent-basic-responses - kind: hosted - protocols: - - protocol: responses - version: 2.0.0 - environment_variables: - - name: AZURE_AI_MODEL_DEPLOYMENT_NAME - value: "{{AZURE_AI_MODEL_DEPLOYMENT_NAME}}" -resources: - - kind: model - id: gpt-4.1-mini - name: AZURE_AI_MODEL_DEPLOYMENT_NAME diff --git a/python/samples/04-hosting/foundry-hosted-agents/responses/basic/agent.yaml b/python/samples/04-hosting/foundry-hosted-agents/responses/basic/agent.yaml deleted file mode 100644 index 9408da5eb40..00000000000 --- a/python/samples/04-hosting/foundry-hosted-agents/responses/basic/agent.yaml +++ /dev/null @@ -1,12 +0,0 @@ -# yaml-language-server: $schema=https://raw.githubusercontent.com/microsoft/AgentSchema/refs/heads/main/schemas/v1.0/ContainerAgent.yaml -kind: hosted -name: agent-framework-agent-basic-responses -protocols: - - protocol: responses - version: 2.0.0 -resources: - cpu: "0.25" - memory: "0.5Gi" -environment_variables: - - name: AZURE_AI_MODEL_DEPLOYMENT_NAME - value: ${AZURE_AI_MODEL_DEPLOYMENT_NAME} diff --git a/python/samples/04-hosting/foundry-hosted-agents/responses/basic/azure.yaml b/python/samples/04-hosting/foundry-hosted-agents/responses/basic/azure.yaml new file mode 100644 index 00000000000..d1c86a9074b --- /dev/null +++ b/python/samples/04-hosting/foundry-hosted-agents/responses/basic/azure.yaml @@ -0,0 +1,37 @@ +# yaml-language-server: $schema=https://raw.githubusercontent.com/Azure/azure-dev/main/schemas/v1.0/azure.yaml.json + +name: agent-framework-agent-basic-responses +services: + ai-project: + host: azure.ai.project + agent-framework-agent-basic-responses: + project: . + host: azure.ai.agent + language: docker + docker: + remoteBuild: true + uses: + - ai-project + container: + resources: + cpu: "0.25" + memory: 0.5Gi + description: > + A basic Agent Framework agent hosted by Foundry. + environmentVariables: + - name: AZURE_AI_MODEL_DEPLOYMENT_NAME + value: ${AZURE_AI_MODEL_DEPLOYMENT_NAME} + kind: hosted + metadata: + tags: + - Agent Framework + - AI Agent Hosting + - Azure AI AgentServer + - Responses Protocol + - Streaming + name: agent-framework-agent-basic-responses + protocols: + - protocol: responses + version: 2.0.0 +infra: + provider: microsoft.foundry