* Bump OpenTelemetry packages to 1.15.3 to fix known vulnerabilities Update OpenTelemetry packages from 1.15.0 to 1.15.3 in Directory.Packages.props to resolve NU1902 warnings-as-errors for CVEs GHSA-g94r-2vxg-569j, GHSA-mr8r-92fq-pj8p, and GHSA-q834-8qmm-v933. Add explicit PackageReference for OpenTelemetry.Exporter.OpenTelemetryProtocol in Foundry.Hosting and OpenTelemetry.Api + OpenTelemetry.Exporter.OpenTelemetryProtocol in Hosted-Invocations-EchoAgent to override transitive 1.15.0 resolution in projects with CentralPackageTransitivePinningEnabled=false. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> * Bump OpenTelemetry Extensions and Instrumentation packages to 1.15.x Align the full OpenTelemetry package set to the 1.15.x family: - OpenTelemetry.Extensions.Hosting: 1.14.0 -> 1.15.3 - OpenTelemetry.Instrumentation.AspNetCore: 1.14.0 -> 1.15.2 - OpenTelemetry.Instrumentation.Http: 1.14.0 -> 1.15.1 - OpenTelemetry.Instrumentation.Runtime: 1.14.0 -> 1.15.1 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Hosted-Invocations-EchoAgent
A minimal echo agent hosted as a Foundry Hosted Agent using the Invocations protocol. The agent reads the request body as plain text, passes it through a custom EchoAIAgent, and writes the echoed text back in the response. No LLM or Azure credentials are required.
Prerequisites
Configuration
Copy the template:
cp .env.example .env
Note:
.envis gitignored. The.env.exampletemplate is checked in as a reference.
Running directly (contributors)
This project uses ProjectReference to build against the local Agent Framework source.
cd dotnet/samples/04-hosting/FoundryHostedAgents/invocations/Hosted-Invocations-EchoAgent
dotnet run
The agent will start on http://localhost:8088.
Test it
curl -X POST http://localhost:8088/invocations \
-H "Content-Type: text/plain" \
-d "Hello, world!"
Expected response:
Echo: Hello, world!
Running with Docker
Since this project uses ProjectReference, the standard Dockerfile cannot resolve dependencies outside this folder. Use Dockerfile.contributor which takes a pre-published output.
1. Publish for the container runtime (Linux Alpine)
dotnet publish -c Debug -f net10.0 -r linux-musl-x64 --self-contained false -o out
2. Build the Docker image
docker build -f Dockerfile.contributor -t hosted-invocations-echo-agent .
3. Run the container
docker run --rm -p 8088:8088 hosted-invocations-echo-agent
4. Test it
curl -X POST http://localhost:8088/invocations \
-H "Content-Type: text/plain" \
-d "Hello from Docker!"
NuGet package users
If you are consuming the Agent Framework as a NuGet package (not building from source), use the standard Dockerfile instead of Dockerfile.contributor. See the commented section in Hosted-Invocations-EchoAgent.csproj for the PackageReference alternative.