Skip to content

[Identity] Update HttpRequest class usage#44993

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

[Identity] Update HttpRequest class usage#44993
pvaneck wants to merge 1 commit intoAzure:mainfrom
pvaneck:identity-http-request

Conversation

@pvaneck
Copy link
Member

@pvaneck pvaneck commented Feb 4, 2026

This updates HttpRequest imports from azure.core.transport to use the HttpRequest class from azure.core.rest. The HttpRequest class from azure.core.transport is considered legacy.

Updating this also enables the transports from corehttp to be used with azure-identity, including the HttpxTransports.

This updates HttpRequest imports from azure.core.transport to use the
HttpRequest class from azure.core.rest. The HttpRequest class from
azure.core.transport is considered legacy.

Updating this also enables the transports from `corehttp` to be used
with azure-identity, including the `HttpxTransports`.

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

Pull request overview

This pull request updates the azure-identity library to use the modern HttpRequest class from azure.core.rest instead of the legacy version from azure.core.pipeline.transport. This change enables compatibility with newer transport implementations from corehttp, including HttpxTransports.

Changes:

  • Replaced all imports of HttpRequest from azure.core.pipeline.transport with azure.core.rest
  • Refactored HttpRequest instantiation to use the modern API (passing parameters directly to constructor instead of using methods like format_parameters, set_formdata_body, set_bytes_body)
  • Updated documentation strings and type hints to reference the new import path
  • Added CHANGELOG entry documenting the change

Reviewed changes

Copilot reviewed 17 out of 17 changed files in this pull request and generated no comments.

Show a summary per file
File Description
sdk/identity/azure-identity/tests/test_managed_identity_client_async.py Updated HttpRequest import from legacy to modern API
sdk/identity/azure-identity/tests/test_managed_identity_client.py Updated HttpRequest import from legacy to modern API
sdk/identity/azure-identity/tests/test_imds_credential_async.py Updated HttpRequest import, kept HttpResponse from transport (correct)
sdk/identity/azure-identity/tests/test_imds_credential.py Updated HttpRequest import, kept HttpResponse from transport (correct)
sdk/identity/azure-identity/tests/perfstress_tests/bearer_token_auth_policy.py Updated HttpRequest import from legacy to modern API
sdk/identity/azure-identity/azure/identity/aio/_internal/aad_client.py Updated HttpRequest import from legacy to modern API
sdk/identity/azure-identity/azure/identity/_internal/msal_client.py Updated import and refactored to use modern HttpRequest constructor API, updated docstrings
sdk/identity/azure-identity/azure/identity/_internal/managed_identity_client.py Updated HttpRequest import from legacy to modern API
sdk/identity/azure-identity/azure/identity/_internal/aad_client_base.py Updated HttpRequest import from legacy to modern API
sdk/identity/azure-identity/azure/identity/_internal/aad_client.py Updated HttpRequest import from legacy to modern API
sdk/identity/azure-identity/azure/identity/_credentials/service_fabric.py Updated import and refactored to pass params directly to HttpRequest constructor
sdk/identity/azure-identity/azure/identity/_credentials/imds.py Updated import and refactored to pass params directly to HttpRequest constructor
sdk/identity/azure-identity/azure/identity/_credentials/cloud_shell.py Updated import and refactored to pass data directly to HttpRequest constructor
sdk/identity/azure-identity/azure/identity/_credentials/azure_ml.py Updated import and refactored to pass params directly to HttpRequest constructor
sdk/identity/azure-identity/azure/identity/_credentials/azure_arc.py Updated import and refactored to pass params directly to HttpRequest constructor
sdk/identity/azure-identity/azure/identity/_credentials/app_service.py Updated import and refactored to pass params directly to HttpRequest constructor
sdk/identity/azure-identity/CHANGELOG.md Added entry documenting the HttpRequest import change with PR reference

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.

1 participant