File tree 1 file changed +9
-0
lines changed
airflow/providers/microsoft/azure/hooks
1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change 28
28
import warnings
29
29
from typing import Any
30
30
31
+ from azure .identity import DefaultAzureCredential
31
32
from azure .kusto .data import ClientRequestProperties , KustoClient , KustoConnectionStringBuilder
32
33
from azure .kusto .data .exceptions import KustoServiceError
33
34
from azure .kusto .data .response import KustoResponseDataSetV2
@@ -183,6 +184,14 @@ def get_required_param(name: str) -> str:
183
184
)
184
185
elif auth_method == "AAD_DEVICE" :
185
186
kcsb = KustoConnectionStringBuilder .with_aad_device_authentication (cluster )
187
+ elif auth_method == "AZURE_TOKEN_CRED" :
188
+ credential = conn .password
189
+ if not credential :
190
+ credential = DefaultAzureCredential ()
191
+ kcsb = KustoConnectionStringBuilder .with_azure_token_credential (
192
+ connection_string = cluster ,
193
+ credential = credential ,
194
+ )
186
195
else :
187
196
raise AirflowException (f"Unknown authentication method: { auth_method } " )
188
197
You can’t perform that action at this time.
0 commit comments