airflow.providers.microsoft.azure.utils
¶
Module Contents¶
Classes¶
Adapt azure-identity credentials for backward compatibility. |
Functions¶
|
Get field from extra, first checking short name, then for backcompat we check for prefixed name. |
|
Attributes¶
- airflow.providers.microsoft.azure.utils.get_field(*, conn_id, conn_type, extras, field_name)[source]¶
Get field from extra, first checking short name, then for backcompat we check for prefixed name.
- airflow.providers.microsoft.azure.utils.get_sync_default_azure_credential: functools.partial[azure.identity.DefaultAzureCredential][source]¶
- airflow.providers.microsoft.azure.utils.get_async_default_azure_credential: functools.partial[azure.identity.aio.DefaultAzureCredential][source]¶
- class airflow.providers.microsoft.azure.utils.AzureIdentityCredentialAdapter(credential=None, resource_id='https://management.azure.com/.default', *, managed_identity_client_id=None, workload_identity_tenant_id=None, **kwargs)[source]¶
Bases:
msrest.authentication.BasicTokenAuthentication
Adapt azure-identity credentials for backward compatibility.
Adapt credentials from azure-identity to be compatible with SD that needs msrestazure or azure.common.credentials
- set_token()[source]¶
Ask the azure-core BearerTokenCredentialPolicy policy to get a token.
Using the policy gives us for free the caching system of azure-core. We could make this code simpler by using private method, but by definition I can’t assure they will be there forever, so mocking a fake call to the policy to extract the token, using 100% public API.
- signed_session(azure_session=None)[source]¶
Create requests session with any required auth headers applied.
If a session object is provided, configure it directly. Otherwise, create a new session and return it.
- Parameters
session (requests.Session) – The session to configure for authentication
- Return type