Skip to content

Comments

Python: Use ad_token_provider for AzureOpenAI#3999

Closed
cecheta wants to merge 1 commit intomicrosoft:mainfrom
cecheta:token-provider
Closed

Python: Use ad_token_provider for AzureOpenAI#3999
cecheta wants to merge 1 commit intomicrosoft:mainfrom
cecheta:token-provider

Conversation

@cecheta
Copy link
Member

@cecheta cecheta commented Feb 17, 2026

Motivation and Context

Closes #3500

Description

Use ad_token_provider by default in Azure clients when a credential is passed, so that:

  • The token is not fetched when the client is created, but instead just before the agent is run
  • The token will be refreshed before it expires without creating a new client

Contribution Checklist

  • The code builds clean without any errors or warnings
  • The PR follows the Contribution Guidelines
  • All unit tests pass, and I have added new tests where possible
  • Is this a breaking change? If yes, add "[BREAKING]" prefix to the title of the PR.

Copilot AI review requested due to automatic review settings February 17, 2026 16:25
@github-actions github-actions bot changed the title Use ad_token_provider for AzureOpenAI Python: Use ad_token_provider for AzureOpenAI Feb 17, 2026
@markwallace-microsoft
Copy link
Member

markwallace-microsoft commented Feb 17, 2026

Python Test Coverage

Python Test Coverage Report •
FileStmtsMissCoverMissing
packages/core/agent_framework
   _types.py9989190%49, 58–59, 113, 118, 137, 139, 143, 147, 149, 151, 153, 171, 175, 201, 223, 228, 233, 237, 263, 267, 613–614, 985, 1047, 1064, 1082, 1087, 1105, 1115, 1132–1133, 1135, 1153–1154, 1156, 1163–1164, 1166, 1201, 1212–1213, 1215, 1253, 1480, 1532, 1623–1628, 1650, 1655, 1821, 1833, 2076, 2085, 2106, 2201, 2426, 2633, 2703, 2715, 2733, 2931–2933, 2936–2938, 2942, 2947, 2951, 3035–3037, 3066, 3120, 3124–3126, 3128, 3139–3140, 3143–3147, 3153
packages/core/agent_framework/azure
   _shared.py74395%183, 196, 208
TOTAL20576322584% 

Python Unit Test Overview

Tests Skipped Failures Errors Time
3958 225 💤 0 ❌ 0 🔥 1m 15s ⏱️

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@cecheta cecheta closed this Feb 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Python: [Feature]: Default to ad_token_provider when providing Azure credential

2 participants