This is an automated email from the ASF dual-hosted git repository.
uranusjr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git
The following commit(s) were added to refs/heads/main by this push:
new 18ef30221e Improve docs on AzureBatchHook DefaultAzureCredential
support (#34098)
18ef30221e is described below
commit 18ef30221ec4b09c295d9e3ab7a21562197548f2
Author: Wei Lee <[email protected]>
AuthorDate: Tue Sep 5 13:52:33 2023 +0800
Improve docs on AzureBatchHook DefaultAzureCredential support (#34098)
---
airflow/providers/microsoft/azure/hooks/batch.py | 1 -
.../connections/azure_batch.rst | 10 ++++++++--
2 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/airflow/providers/microsoft/azure/hooks/batch.py
b/airflow/providers/microsoft/azure/hooks/batch.py
index cfa99fcf94..e882d7e157 100644
--- a/airflow/providers/microsoft/azure/hooks/batch.py
+++ b/airflow/providers/microsoft/azure/hooks/batch.py
@@ -104,7 +104,6 @@ class AzureBatchHook(BaseHook):
credentials = AzureIdentityCredentialAdapter(
None, resource_id="https://batch.core.windows.net/.default"
)
- # credentials = AzureIdentityCredentialAdapter()
batch_client = BatchServiceClient(credentials,
batch_url=batch_account_url)
return batch_client
diff --git
a/docs/apache-airflow-providers-microsoft-azure/connections/azure_batch.rst
b/docs/apache-airflow-providers-microsoft-azure/connections/azure_batch.rst
index b146bb09ac..8bac555cb4 100644
--- a/docs/apache-airflow-providers-microsoft-azure/connections/azure_batch.rst
+++ b/docs/apache-airflow-providers-microsoft-azure/connections/azure_batch.rst
@@ -32,6 +32,10 @@ There is one way to connect to Azure Batch using Airflow.
1. Use `Azure Shared Key Credential
<https://docs.microsoft.com/en-us/rest/api/storageservices/authorize-with-shared-key>`_
i.e. add shared key credentials to the Airflow connection.
+2. Fallback on `DefaultAzureCredential
+
<https://docs.microsoft.com/en-us/python/api/overview/azure/identity-readme?view=azure-python#defaultazurecredential>`_.
+ This includes a mechanism to try different options to authenticate: Managed
System Identity, environment variables, authentication through Azure CLI and
etc.
+
Default Connection IDs
----------------------
@@ -41,11 +45,13 @@ All hooks and operators related to Microsoft Azure Batch
use ``azure_batch_defau
Configuring the Connection
--------------------------
-Batch Account Name
+Batch Account Name (optional)
Specify the Azure Batch Account Name used for the initial connection.
+ It can be left out to fall back on ``DefaultAzureCredential``.
-Batch Account Access Key
+Batch Account Access Key (optional)
Specify the access key used for the initial connection.
+ It can be left out to fall back on ``DefaultAzureCredential``.
Batch Account URL
Specify the batch account URL you would like to use.