File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -443,10 +443,18 @@ async def setup_clients():
443
443
# Use the current user identity for keyless authentication to Azure services.
444
444
# This assumes you use 'azd auth login' locally, and managed identity when deployed on Azure.
445
445
# The managed identity is setup in the infra/ folder.
446
+ azure_credential : Union [AzureDeveloperCliCredential , ManagedIdentityCredential ]
446
447
if os .getenv ("WEBSITE_HOSTNAME" ):
448
+ current_app .logger .info ("Setting up Azure credential using ManagedIdentityCredential" )
447
449
azure_credential = ManagedIdentityCredential ()
448
- else :
450
+ elif AZURE_TENANT_ID :
451
+ current_app .logger .info (
452
+ "Setting up Azure credential using AzureDeveloperCliCredential with tenant_id %s" , AZURE_TENANT_ID
453
+ )
449
454
azure_credential = AzureDeveloperCliCredential (tenant_id = AZURE_TENANT_ID )
455
+ else :
456
+ current_app .logger .info ("Setting up Azure credential using AzureDeveloperCliCredential for home tenant" )
457
+ azure_credential = AzureDeveloperCliCredential ()
450
458
451
459
# Set up clients for AI Search and Storage
452
460
search_client = SearchClient (
You can’t perform that action at this time.
0 commit comments