feat: Use ManagedIdentityCredential instead of DefaultAzureCredentials#235
Merged
Prajwal-Microsoft merged 9 commits intodevfrom Jul 31, 2025
Merged
feat: Use ManagedIdentityCredential instead of DefaultAzureCredentials#235Prajwal-Microsoft merged 9 commits intodevfrom
Prajwal-Microsoft merged 9 commits intodevfrom
Conversation
Merged
4 tasks
|
🎉 This PR is included in version 1.9.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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 a significant refactor to standardize Azure credential handling across the codebase by replacing
DefaultAzureCredentialwith a new utility function,get_azure_credential. The utility dynamically selects the appropriate credential type (DefaultAzureCredentialorManagedIdentityCredential) based on the environment (devorprod). Additionally, environment variable support forAPP_ENVhas been added, and unit tests for the credential utility have been implemented. Below is a summary of the most important changes:Azure Credential Handling Refactor:
get_azure_credentialandget_azure_credential_asyncinhelpers/azure_credential_utils.pyto dynamically select credentials based on theAPP_ENVenvironment variable.DefaultAzureCredentialwithget_azure_credentialacross various files, including:application_context.py[1] [2]app_configuration.py[1] [2]azure_openai.pycontent_understanding.pystorage_blob.py[1] [2]pipeline_queue_helper.py[1] [2] [3] [4]remote_module_loader.py[1] [2]main.py[1] [2]storage_queue/helper.py[1] [2]Environment Variable Support:
APP_ENVenvironment variable toinfra/main.bicepfor multiple modules to support environment-specific configurations. [1] [2] [3] [4].env.devfile to defineAPP_ENV=devfor local development.Unit Testing:
test_azure_credential_utils.pyto validate both synchronous and asynchronous credential selection logic.These changes improve the maintainability and flexibility of the codebase by consolidating credential logic, enabling environment-specific behavior, and adding robust test coverage.
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information