eladkal commented on code in PR #67600:
URL: https://github.com/apache/airflow/pull/67600#discussion_r3582028150


##########
providers/microsoft/azure/src/airflow/providers/microsoft/azure/hooks/batch.py:
##########
@@ -101,20 +103,23 @@ def get_conn(self) -> BatchServiceClient:
         if not batch_account_url:
             raise AirflowException("Batch Account URL parameter is missing.")
 
-        credentials: batch_auth.SharedKeyCredentials | 
AzureIdentityCredentialAdapter
-        if all([conn.login, conn.password]):
-            credentials = batch_auth.SharedKeyCredentials(conn.login, 
conn.password)
+        credential: AzureNamedKeyCredential | AzureIdentityCredentialAdapter
+        if conn.login and conn.password:
+            credential = AzureNamedKeyCredential(conn.login, conn.password)
         else:
             managed_identity_client_id = 
conn.extra_dejson.get("managed_identity_client_id")
             workload_identity_tenant_id = 
conn.extra_dejson.get("workload_identity_tenant_id")
-            credentials = AzureIdentityCredentialAdapter(
+            credential = AzureIdentityCredentialAdapter(
                 None,
                 resource_id="https://batch.core.windows.net/.default";,
                 managed_identity_client_id=managed_identity_client_id,
                 workload_identity_tenant_id=workload_identity_tenant_id,
             )
 
-        batch_client = BatchServiceClient(credentials, 
batch_url=batch_account_url)
+        batch_client = BatchClient(
+            endpoint=batch_account_url,
+            credential=credential,  # type: ignore[arg-type]

Review Comment:
   cc @arieleli01212 can you address this review comment?



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to