Repository navigation
Description
Observed Behavior
Microsoft.Agents.AI.Foundry.Hosting (1.20.0-preview.260831.1 through 1.28.0-preview.261106.1) depends on Azure.AI.AgentServer.Core (1.0.0-beta.28 / 1.0.0-beta.30) and Azure.AI.AgentServer.Responses (1.0.0-beta.8 / 1.0.0-beta.9):
dotnet/Directory.Packages.props#L27-L29(dotnet-1.28.0)Microsoft.Agents.AI.Foundry.Hosting.csproj#L35-L36(dotnet-1.28.0)
Azure.AI.AgentServer.Core (<= 1.0.0-beta.31) declares Microsoft.OpenTelemetry >= 1.0.0-beta.1 (Azure.AI.AgentServer.Core.Packages.props#L3 (Azure.AI.AgentServer.Core_1.0.0-beta.31)), so NuGet resolves Microsoft.OpenTelemetry 1.0.0-beta.1 (2026-04-27).
In Foundry hosted agents, this causes three problems:
- Non-OTel-compliant
invoke_agentmessages:Microsoft.OpenTelemetry1.0.0-beta.1rewritesgen_ai.input.messagesandgen_ai.output.messagesinto{"version":"0.1.0","messages":[...]}instead of a JSON array (AgentFrameworkSpanProcessor.cs#L41-L54(v1.0.0-beta.1); fixed in1.0.3via microsoft/opentelemetry-distro-dotnet#105). Foundry portal shows raw JSON and trace evaluations drop every turn. - Agent 365 batch export crash: Every export batch containing agent or chat spans throws
System.ArgumentException: An item with the same key has already been added. Key: gen_ai.conversation.id(ExportFormatter.cs#L274-L284(v1.0.3); fixed in1.0.4via microsoft/opentelemetry-distro-dotnet#112) because bothFoundryEnrichmentProcessorandOpenTelemetryChatClientwritegen_ai.conversation.id. - Startup crash if
Microsoft.OpenTelemetryis upgraded to>= 1.0.3:Microsoft.OpenTelemetry1.0.3removedAgent365Options.Exporter(commitb5464eab), whileAzure.AI.AgentServer.Core<= 1.0.0-beta.31still callsoptions.Agent365.Exporter.*(OpenTelemetryExtensions.cs#L210-L211(Azure.AI.AgentServer.Core_1.0.0-beta.31)). When the Foundry platform setsFOUNDRY_AGENT365_TRACING_ENABLED=true,AgentHostBuilder.Build()crashes at startup (HTTP 424 session_not_ready) withSystem.MissingMethodException.
Expected Behavior
Microsoft.Agents.AI.Foundry.Hosting pulls in Azure.AI.AgentServer.Core and Azure.AI.AgentServer.Responses versions built against Microsoft.OpenTelemetry >= 1.0.4, so that:
invoke_agentspans emit standard OpenTelemetry JSON arrays forgen_ai.input.messagesandgen_ai.output.messages.- Agent 365 telemetry batches export without
ArgumentExceptionon duplicategen_ai.conversation.idtags. - Hosted agents start cleanly when
FOUNDRY_AGENT365_TRACING_ENABLED=true.
Steps to Reproduce
- Create a
.NET 10.0web project referencingMicrosoft.Agents.AI.Foundry.Hosting(1.28.0-preview.261106.1or1.20.0-preview.260831.1). - Deploy as a Foundry hosted agent (where
FOUNDRY_AGENT365_TRACING_ENABLED=trueandOTEL_INSTRUMENTATION_GENAI_CAPTURE_MESSAGE_CONTENT=trueare enabled) and invoke/responses— observe{"version":"0.1.0","messages":[...]}oninvoke_agentspans andArgumentException(Key: gen_ai.conversation.id) in Agent 365 export. - Add
<PackageReference Include="Microsoft.OpenTelemetry" Version="1.0.4" />(or1.2.0) to pick up the telemetry fixes, keepFOUNDRY_AGENT365_TRACING_ENABLED=true, and runAgentHost.CreateBuilder(args).Build()— observe unhandledSystem.MissingMethodExceptionat startup.
Minimal Reproduction
<!-- Repro.csproj -->
<Project Sdk="Microsoft.NET.Sdk.Web">
<PropertyGroup>
<TargetFramework>net10.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Agents.AI.Foundry.Hosting" Version="1.28.0-preview.261106.1" />
<!-- Upgrading Microsoft.OpenTelemetry to >= 1.0.3 to fix the 1.0.0-beta.1 bugs triggers MissingMethodException: -->
<PackageReference Include="Microsoft.OpenTelemetry" Version="1.0.4" />
</ItemGroup>
</Project>// Program.cs
Environment.SetEnvironmentVariable("FOUNDRY_HOSTING_ENVIRONMENT", "hosted");
Environment.SetEnvironmentVariable("FOUNDRY_AGENT365_TRACING_ENABLED", "true");
Environment.SetEnvironmentVariable("FOUNDRY_AGENT_INSTANCE_CLIENT_ID", "00000000-0000-0000-0000-000000000001");
var builder = AgentHost.CreateBuilder(args);
var app = builder.Build(); // Throws System.MissingMethodException: Agent365Options.get_Exporter()Error Messages and Stack Traces
Unhandled exception. System.MissingMethodException: Method not found: 'Microsoft.Agents.A365.Observability.Runtime.Tracing.Exporters.Agent365ExporterOptions Microsoft.OpenTelemetry.Agent365Options.get_Exporter()'.
at Azure.AI.AgentServer.Core.Internal.OpenTelemetryExtensions.ConfigureAgent365Export(MicrosoftOpenTelemetryOptions options)
at Azure.AI.AgentServer.Core.Internal.OpenTelemetryExtensions.<>c.<AddAgentHostTelemetry>b__1_0(MicrosoftOpenTelemetryOptions options)
at Microsoft.OpenTelemetry.MicrosoftOpenTelemetryBuilderExtensions.UseMicrosoftOpenTelemetry(IOpenTelemetryBuilder builder, Action`1 configure)
at Azure.AI.AgentServer.Core.Internal.OpenTelemetryExtensions.AddAgentHostTelemetry(IServiceCollection services, Action`1 configureTracing)
at Azure.AI.AgentServer.Core.AgentHostBuilder.Build()
Package Versions
Microsoft.Agents.AI.Foundry.Hosting: 1.28.0-preview.261106.1 (also reproduced on 1.20.0-preview.260831.1), Microsoft.Agents.AI.Foundry: 1.28.0-preview.261106.1, Microsoft.Agents.AI: 1.28.0
.NET Version
.NET 10.0
Operating System
Linux
Regression
No
Additional Context
Upstream issue in Azure/azure-sdk-for-net: Azure/azure-sdk-for-net#65007
Because NuGet resolves the lowest compatible version in a dependency range, hosted-agent projects that reference Microsoft.Agents.AI.Foundry.Hosting without pinning Azure.AI.AgentServer.Core directly will continue resolving Azure.AI.AgentServer.Core 1.0.0-beta.30 -> Microsoft.OpenTelemetry 1.0.0-beta.1 even after Azure/azure-sdk-for-net publishes fixed betas.
Once Azure/azure-sdk-for-net#65007 ships updated Azure.AI.AgentServer.Core and Azure.AI.AgentServer.Responses betas, please update both versions in dotnet/Directory.Packages.props#L27-L29 (and Microsoft.Agents.AI.Foundry.Hosting.csproj#L34) and publish an updated Microsoft.Agents.AI.Foundry.Hosting preview.
Acknowledgements
- I searched existing issues and did not find a duplicate.
- I personally verified this behavior and the reproduction details are authentic.
- I will wait for explicit maintainer agreement before starting implementation of a non-trivial change.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNo status
Activity
github-actions commentedon Nov 17, 2026
Routing result: inconclusive, not reproduced. I did not run a reproduction. It needs a Foundry hosted environment plus the external
Azure.AI.AgentServer.CoreandMicrosoft.OpenTelemetrypackages, and neither is available in this sandbox.Source check on the base checkout (
f8ade3e):dotnet/Directory.Packages.propspinsAzure.AI.AgentServer.Core1.0.0-beta.30andAzure.AI.AgentServer.Responses1.0.0-beta.9, which matches the report. The failures described are inAzure.AI.AgentServer.CoreandMicrosoft.OpenTelemetry, so the cause appears to be external to this repo. The fix looks like it depends on the upstreamAzure/azure-sdk-for-netrelease tracked in the linked issue.Support boundary: unclear. I found no maintained spec or decision record that sets how this package's telemetry dependencies are supported, so a maintainer should decide the scope.
Routed to the Foundry Hosting owner for maintainer triage. This does not mean the report or its priority has been accepted. Run: https://github.com/microsoft/agent-framework/actions/runs/43984804425