You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "Lee-W (via GitHub)" <gi...@apache.org> on 2023/08/16 11:01:22 UTC

[GitHub] [airflow] Lee-W commented on a diff in pull request #33433: feat(providers/microsoft): add DefaultAzureCredential to data_lake

Lee-W commented on code in PR #33433:
URL: https://github.com/apache/airflow/pull/33433#discussion_r1295728983


##########
airflow/providers/microsoft/azure/hooks/data_lake.py:
##########
@@ -308,18 +310,18 @@ def get_conn(self) -> DataLakeServiceClient:  # type: ignore[override]
             # connection_string auth takes priority
             return DataLakeServiceClient.from_connection_string(connection_string, **extra)
 
+        credential: Credentials
         tenant = self._get_field(extra, "tenant_id")
         if tenant:
             # use Active Directory auth
             app_id = conn.login
             app_secret = conn.password
-            token_credential = ClientSecretCredential(tenant, app_id, app_secret)
-            return DataLakeServiceClient(
-                account_url=f"https://{conn.host}.dfs.core.windows.net", credential=token_credential, **extra
-            )
+            credential = ClientSecretCredential(tenant, app_id, app_secret)
+        elif conn.password:
+            credential = conn.password
+        else:
+            credential = DefaultAzureCredential()

Review Comment:
   Sure. I'll test and post a screenshot before I mark these PRs as read to review



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