Skip to content

Fix python AF sample#191

Merged
rahuldevikar761 merged 3 commits into
mainfrom
radevika/fix-agentframework-sample
Jan 28, 2026
Merged

Fix python AF sample#191
rahuldevikar761 merged 3 commits into
mainfrom
radevika/fix-agentframework-sample

Conversation

@rahuldevikar761

Copy link
Copy Markdown
Collaborator

No description provided.

@rahuldevikar761 rahuldevikar761 requested a review from a team as a code owner January 27, 2026 20:04
Copilot AI review requested due to automatic review settings January 27, 2026 20:04

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes the Python Agent Framework sample by making authentication optional for local development and improving Azure OpenAI authentication flexibility.

Changes:

  • Makes authentication handler configurable via AUTH_HANDLER_NAME environment variable (defaults to None/disabled)
  • Adds support for API key authentication as an alternative to Azure CLI credentials for Azure OpenAI
  • Simplifies ToolingManifest.json by removing hardcoded URL, scope, and audience fields

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 6 comments.

File Description
host_agent_server.py Adds AUTH_HANDLER_NAME configuration with conditional authentication setup; updates token exchange to only run when auth handler is configured; adds logging for auth status
agent.py Adds AZURE_OPENAI_API_KEY support with fallback to Azure CLI credentials; improves credential selection logging
ToolingManifest.json Removes hardcoded URL, scope, and audience fields, keeping only server name identifiers

Comment thread python/agent-framework/sample-agent/host_agent_server.py Outdated
Comment thread python/agent-framework/sample-agent/agent.py
Comment thread python/agent-framework/sample-agent/host_agent_server.py
Comment thread python/agent-framework/sample-agent/host_agent_server.py
Comment thread python/agent-framework/sample-agent/host_agent_server.py Outdated
Comment thread python/agent-framework/sample-agent/host_agent_server.py Outdated
Comment thread python/agent-framework/sample-agent/ToolingManifest.json
mrunalhirve128
mrunalhirve128 previously approved these changes Jan 27, 2026
pontemonti
pontemonti previously approved these changes Jan 28, 2026
- Remove unnecessary f-prefix from log messages without interpolation
- Add context (tenant_id, agent_id) to observability token log messages
- Update type hints to use Optional[str] for auth_handler_name
- Document AUTH_HANDLER_NAME in .env.template
@rahuldevikar761 rahuldevikar761 enabled auto-merge (squash) January 28, 2026 00:12
@rahuldevikar761 rahuldevikar761 merged commit 50a474e into main Jan 28, 2026
26 checks passed
@rahuldevikar761 rahuldevikar761 deleted the radevika/fix-agentframework-sample branch January 28, 2026 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants