Skip to content

Auth config is not created in python/agent-framework sample and auth_handlers is not working #171

@lsl-2020

Description

@lsl-2020

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: #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

auth_config = host.create_auth_configuration()
.

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":

Image

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)

Image

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'python\agent-framework\sample-agent', set up things according to the Configure Agent Testing
  2. Run uv run python start_with_generic_host.py and agentplayground in two terminals.
  3. 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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions