Skip to content

[Identity] Add RequestIdPolicy to default pipeline policies#46070

Open
pvaneck wants to merge 1 commit intoAzure:mainfrom
pvaneck:identity-requestid
Open

[Identity] Add RequestIdPolicy to default pipeline policies#46070
pvaneck wants to merge 1 commit intoAzure:mainfrom
pvaneck:identity-requestid

Conversation

@pvaneck
Copy link
Copy Markdown
Member

@pvaneck pvaneck commented Apr 1, 2026

This aids debugging requests.

Signed-off-by: Paul Van Eck <paulvaneck@microsoft.com>
Copy link
Copy Markdown
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.

Pull request overview

This PR improves request debuggability in azure-identity by ensuring the identity pipeline automatically attaches a client request ID header (x-ms-client-request-id) to outgoing requests.

Changes:

  • Added RequestIdPolicy to the default (sync/async) pipeline policy list in azure.identity._internal.pipeline.
  • Updated sync/async AAD client tests to assert the x-ms-client-request-id header is present.
  • Documented the change in the azure-identity changelog.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
sdk/identity/azure-identity/azure/identity/_internal/pipeline.py Adds RequestIdPolicy to the default pipeline policies so request IDs are generated/sent automatically.
sdk/identity/azure-identity/tests/test_aad_client.py Verifies the request ID header is present in outgoing token requests (sync).
sdk/identity/azure-identity/tests/test_aad_client_async.py Verifies the request ID header is present in outgoing token requests (async).
sdk/identity/azure-identity/CHANGELOG.md Notes the addition of RequestIdPolicy to default pipeline policies.

@pvaneck pvaneck marked this pull request as ready for review April 2, 2026 00:44
@pvaneck pvaneck requested review from a team and xiangyan99 as code owners April 2, 2026 00:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

2 participants