You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "pankajastro (via GitHub)" <gi...@apache.org> on 2023/08/25 07:43:27 UTC
[GitHub] [airflow] pankajastro commented on a diff in pull request #33469: feat(providers/microsoft): add DefaultAzureCredential support to AzureBatchHook
pankajastro commented on code in PR #33469:
URL: https://github.com/apache/airflow/pull/33469#discussion_r1305307360
##########
airflow/providers/microsoft/azure/hooks/batch.py:
##########
@@ -96,7 +96,15 @@ def get_conn(self):
if not batch_account_url:
raise AirflowException("Batch Account URL parameter is missing.")
- credentials = batch_auth.SharedKeyCredentials(conn.login, conn.password)
+ credentials: batch_auth.SharedKeyCredentials | AzureIdentityCredentialAdapter
+ if all([conn.login, conn.password]):
+ credentials = batch_auth.SharedKeyCredentials(conn.login, conn.password)
+ else:
+ credentials = AzureIdentityCredentialAdapter(
+ None, resource_id="https://batch.core.windows.net/.default"
+ )
+ # credentials = AzureIdentityCredentialAdapter()
Review Comment:
```suggestion
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org