microsoft / microsoft/Agent365-Samples
Auth config is not created in python/agent-framework sample and auth_handlers is not working
@pontemonti is already working on this.
Since Jan 22, 2026.
- Dominant language
- C#
- Stars
- 108
- Forks
- 59
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
Auth config is not created because environment variables do not match the code. As is described in detail of a previous issue: https://github.com/microsoft/Agent365-Samples/issues/128.
Because the auth config uses CLIENT_ID/TENANT_ID/CLIENT_SECRET and what we have in .env are CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTID/CONNECTIONS__SERVICE_CONNECTION__SETTINGS__TENANTID/CONNECTIONS__SERVICE_CONNECTION__SETTINGS__CLIENTSECRET, the auth_config will be always NONE, as is assigned in https://github.com/microsoft/Agent365-Samples/blob/01e3947f23c0caf97518ae48d44744a74b76d020/python/agent-framework/sample-agent/host_agent_server.py#L79.
Therefore, to make the code locally run well, we need to remove auth_handlers=handler when registering events because the handler is NONE. Here is the necessary code changes to make local execution work for "membersAdded" and "/help" and "message":
So my question here is: Is the mismatching for auth env variables by design? How can we run the sample locally using agentic authetication?
(After removing auth_handlers=handler, the local python app works as expected with my Azure OpenAI service as chat app, as is shown below)
To Reproduce
Steps to reproduce the behavior:
- Go to 'python\agent-framework\sample-agent', set up things according to the Configure Agent Testing
- Run
uv run python start_with_generic_host.pyandagentplaygroundin two terminals. - See error (the agentplayground won't response to any expected events at all).
Expected behavior
The agent will respond to local events registered.
Screenshots
Attached in bug description section.
Environment (please complete the following information):
- OS: Windows 11 25H2
- SDK Version: A365 CLI (1.1.40-preview+4c5eb33773); UV (0.9.24 (0fda1525e 2026-01-09)); Python 3.14.0
Additional context
Add any other context about the problem here.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.