File tree Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Expand file tree Collapse file tree 1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -449,7 +449,16 @@ async def setup_clients():
449
449
azure_credential : Union [AzureDeveloperCliCredential , ManagedIdentityCredential ]
450
450
if RUNNING_ON_AZURE :
451
451
current_app .logger .info ("Setting up Azure credential using ManagedIdentityCredential" )
452
- azure_credential = ManagedIdentityCredential ()
452
+ if AZURE_CLIENT_ID := os .getenv ("AZURE_CLIENT_ID" ):
453
+ # ManagedIdentityCredential should use AZURE_CLIENT_ID if set in env, but its not working for some reason,
454
+ # so we explicitly pass it in as the client ID here. This is necessary for user-assigned managed identities.
455
+ current_app .logger .info (
456
+ "Setting up Azure credential using ManagedIdentityCredential with client_id %s" , AZURE_CLIENT_ID
457
+ )
458
+ azure_credential = ManagedIdentityCredential (client_id = AZURE_CLIENT_ID )
459
+ else :
460
+ current_app .logger .info ("Setting up Azure credential using ManagedIdentityCredential" )
461
+ azure_credential = ManagedIdentityCredential ()
453
462
elif AZURE_TENANT_ID :
454
463
current_app .logger .info (
455
464
"Setting up Azure credential using AzureDeveloperCliCredential with tenant_id %s" , AZURE_TENANT_ID
You can’t perform that action at this time.
0 commit comments