- Package Name:
azure-ai-projects / agent-framework-foundry-hosting / azure-ai-agentserver-responses
- Package Version: 2.1.0 / 1.0.0a260507 / 1.0.0b5
- Python Version: 3.13.13
Describe the bug
When sending requests to a Foundry-hosted agent (via the azure-ai-projects OpenAI client) from within an Azure Function, sessions are not visible on the Foundry-hosted agent side.
- Application Insights traces show that a
microsoft.session.id is generated internally on invoke_agent spans, but the session never appears in the Foundry portal.
- Even when I explicitly create a session manually using
beta.agents.create_session, the session still does not show up in the Foundry portal.
- Running the exact same code locally (using
FoundryAgent, openai_client, or raw HTTP) works fine — sessions are created and visible as expected.
This raises a concern: if sessions are not properly registered when requests come from Azure Functions, independent invocations may be sharing context unintentionally, which could lead to data leakage between unrelated requests.
To Reproduce
- From an Azure Function, send a request to a Foundry-hosted agent using
azure-ai-projects (OpenAI client / responses API).
- Check the Foundry portal — no session appears.
- Try manually creating a session via
beta.agents.create_session — still not visible.
- Run the same code locally — sessions are created and visible normally.
Expected behavior
- Sessions should be created and visible in the Foundry portal regardless of whether the request originates from a local environment or an Azure Function.
- Each Function invocation should be properly isolated to avoid context leakage between requests.
Additional context
- Issue only occurs when the code runs inside an Azure Function; identical code works locally.
- Authentication: Managed Identity, AzureCliCredential
- Main concern: potential cross-request context bleeding between independent Function invocations.
azure-ai-projects/agent-framework-foundry-hosting/azure-ai-agentserver-responsesDescribe the bug
When sending requests to a Foundry-hosted agent (via the
azure-ai-projectsOpenAI client) from within an Azure Function, sessions are not visible on the Foundry-hosted agent side.microsoft.session.idis generated internally oninvoke_agentspans, but the session never appears in the Foundry portal.beta.agents.create_session, the session still does not show up in the Foundry portal.FoundryAgent,openai_client, or raw HTTP) works fine — sessions are created and visible as expected.This raises a concern: if sessions are not properly registered when requests come from Azure Functions, independent invocations may be sharing context unintentionally, which could lead to data leakage between unrelated requests.
To Reproduce
azure-ai-projects(OpenAI client / responses API).beta.agents.create_session— still not visible.Expected behavior
Additional context