Reapply "update AzureBaseHook to return credentials that supports get_token method"#56228
Merged
jscheffl merged 6 commits intoOct 3, 2025
Merged
Conversation
Member
|
Opening-and-closing to trigger a full test run |
Member
|
This probably needs rebasing to latest main |
karunpoudel
force-pushed
the
azurebasehook-creds-support-get_token
branch
2 times, most recently
from
September 30, 2025 15:14
e33810b to
43938a1
Compare
prdai
reviewed
Sep 30, 2025
karunpoudel
force-pushed
the
azurebasehook-creds-support-get_token
branch
from
September 30, 2025 17:15
591e1d9 to
f8b4d87
Compare
…-support-get_token
Contributor
Author
|
the pr check failures doesn't seem to be related to the code changes |
Contributor
Yeah seem un-realted. Let's wait a moment until main is green again and then have another re-base. Hope then it is working. |
prdai
approved these changes
Oct 1, 2025
Contributor
Author
|
most of the tests have passed (except for the one failing in main), so might be safe to merge this |
jscheffl
approved these changes
Oct 3, 2025
jscheffl
left a comment
Contributor
There was a problem hiding this comment.
Double-checked and tests on main are the same failing here as well. Therefore OK to merge in my view. Hope main is green asap again.
dabla
pushed a commit
to dabla/airflow
that referenced
this pull request
Oct 12, 2025
…_token method" (apache#56228) * all changes and fixed * more fix --------- Co-authored-by: Karun Poudel <64540927+karunpoudel-chr@users.noreply.github.com>
69 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Reapply #52182
Databases like Snowflake and Azure Postgres Flex support connection using Azure OAUTH token. Newer Azure Identity credential objects like
ClientSecretCredentialandDefaultAzureCredentialsupportget_tokenmethod which can be used to generate OAUTH token. SnowflakeHook and PostgresHook can leverage AzureBaseHook to retrieve required token.In this PR:
get_credentialmethod and makesdk_clientargument optional so that the credential object can be retrieved without needing sdk_client. eg.AzureBaseHook().get_credential()use_azure_identity_objectin connection for backward compatibility. When set to true,get_credentialmethod will return newer credential object of typeClientSecretCredentialorDefaultAzureCredentialinstead of currentServicePrincipalCredentialsorAzureIdentityCredentialAdapter. Current credential object doesn't supportget_tokenmethod. eg.AzureBaseHook().get_credential().get_token()I am ok with not making
sdk_clientargument optional if there is any concern.Usage:
Create base azure connection using either client_secret or default azure credential.
Use above connection to retrieve token to connect to specific resource (e.g., azure postgres flex server).
PostgresHook could be updated to retrieve token using azure connection similar to how it currently uses aws connection.
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.