File tree Expand file tree Collapse file tree 2 files changed +3
-6
lines changed
Expand file tree Collapse file tree 2 files changed +3
-6
lines changed Original file line number Diff line number Diff line change @@ -44,4 +44,3 @@ def __init__(self):
4444 self .azure_cosmosdb_enable_feedback = os .getenv ("AZURE_COSMOSDB_ENABLE_FEEDBACK" , "false" ).lower () == "true"
4545
4646 self .solution_name = os .getenv ("SOLUTION_NAME" , "" )
47- self .app_env = os .getenv ("APP_ENV" , "Prod" ).lower ()
Original file line number Diff line number Diff line change 1- from common . config . config import Config
1+ import os
22from azure .identity import ManagedIdentityCredential , DefaultAzureCredential
33from azure .identity .aio import ManagedIdentityCredential as AioManagedIdentityCredential , DefaultAzureCredential as AioDefaultAzureCredential
44
@@ -16,8 +16,7 @@ async def get_azure_credential_async(client_id=None):
1616 Returns:
1717 Credential object: Either AioDefaultAzureCredential or AioManagedIdentityCredential.
1818 """
19- config = Config ()
20- if config .app_env == 'dev' :
19+ if os .getenv ("APP_ENV" , "prod" ).lower () == 'dev' :
2120 return AioDefaultAzureCredential () # CodeQL [SM05139] Okay use of DefaultAzureCredential as it is only used in development
2221 else :
2322 return AioManagedIdentityCredential (client_id = client_id )
@@ -36,8 +35,7 @@ def get_azure_credential(client_id=None):
3635 Returns:
3736 Credential object: Either DefaultAzureCredential or ManagedIdentityCredential.
3837 """
39- config = Config ()
40- if config .app_env == 'dev' :
38+ if os .getenv ("APP_ENV" , "prod" ).lower () == 'dev' :
4139 return DefaultAzureCredential () # CodeQL [SM05139] Okay use of DefaultAzureCredential as it is only used in development
4240 else :
4341 return ManagedIdentityCredential (client_id = client_id )
You can’t perform that action at this time.
0 commit comments