feat: replacing DefaultAzureCredential with ManagedIdentityCredential #350
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Purpose
This pull request introduces changes to improve Azure credential handling by introducing a utility for managing credentials based on the environment (
devorprod). It also updates various files to use this utility, adds environment variable support forAPP_ENV, and includes new tests for the credential utility.Azure credential management improvements:
helpers/azure_credential_utils.pyto provide synchronous and asynchronous credential utilities that switch betweenDefaultAzureCredentialfordevenvironments andManagedIdentityCredentialforprodenvironments.src/backend/app_config.py,src/backend/config_kernel.py,src/backend/context/cosmos_memory_kernel.py, andsrc/backend/utils_kernel.pyto replace direct usage ofDefaultAzureCredentialwith the new utilityget_azure_credential. [1] [2] [3] [4] [5] [6]Environment variable updates:
APP_ENVenvironment variable in.env.samplefiles for both backend and frontend to specify the application environment (devorprod). [1] [2]infra/main.bicepto includeAPP_ENVin container app and website configurations. [1] [2]Testing enhancements:
src/backend/tests/helpers/test_azure_credential_utils.pyto test both synchronous and asynchronous credential utilities fordevandprodenvironments.DefaultAzureCredentialfromsrc/backend/tests/test_config.py.Does this introduce a breaking change?
How to Test
What to Check
Verify that the following are valid
Other Information