You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/11/06 21:21:38 UTC

[GitHub] [airflow] sdebruyn commented on a change in pull request #19079: use DefaultAzureCredential if login not provided for Data Factory

sdebruyn commented on a change in pull request #19079:
URL: https://github.com/apache/airflow/pull/19079#discussion_r744169578



##########
File path: airflow/providers/microsoft/azure/hooks/data_factory.py
##########
@@ -144,10 +144,13 @@ def get_conn(self) -> DataFactoryManagementClient:
         tenant = conn.extra_dejson.get('extra__azure_data_factory__tenantId')
         subscription_id = conn.extra_dejson.get('extra__azure_data_factory__subscriptionId')
 
-        self._conn = DataFactoryManagementClient(
-            credential=ClientSecretCredential(
+        credential = DefaultAzureCredential()
+        if conn.login is not None and conn.password is not None:
+            credential = ClientSecretCredential(
                 client_id=conn.login, client_secret=conn.password, tenant_id=tenant
-            ),
+            )
+        self._conn = DataFactoryManagementClient(
+            credential=credential,

Review comment:
       @eladkal @josh-fell test added :) thank you for your patience with my first PR!




-- 
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