fix: Select Azure credentials by environment - #1043
Open
PrekshithD-Microsoft wants to merge 1 commit into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates Azure authentication selection so the app can use system-assigned or user-assigned Managed Identity (via a new azure_client_id setting) outside of development environments, and upgrades azure-identity to support newer identity features.
Changes:
- Add
azure_client_idtoSettingsfor user-assigned managed identity configuration. - Update Azure credential creation in Azure Search data source, Azure Storage, and Queue Service to choose credentials based on
app_env. - Upgrade
azure-identityfrom1.19.0to1.25.3.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| src/api/config.py | Adds azure_client_id setting for configuring user-assigned managed identity. |
| src/api/modules/data_sources/azure_search.py | Switches credential selection based on environment when creating SearchClient. |
| src/api/modules/ingestion/azure_storage.py | Switches credential selection based on environment for Blob/Search clients. |
| src/api/modules/ingestion/queue_service.py | Switches credential selection based on environment for Queue clients. |
| src/api/requirements.txt | Upgrades azure-identity dependency. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
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.
This pull request updates Azure authentication handling across several modules to support both system-assigned and user-assigned managed identities, configurable via a new
azure_client_idsetting. It also upgrades theazure-identitypackage for improved compatibility. The most important changes are grouped below:Authentication logic updates:
azure_client_idfield to theSettingsclass insrc/api/config.py, allowing configuration of a user-assigned managed identity. If left empty, the system-assigned identity is used.AzureSearchDataSource, Azure Storage, and Queue Service modules to selectDefaultAzureCredentialin development andManagedIdentityCredential(with optionalclient_id) in other environments. [1] [2] [3]Dependency upgrades:
azure-identityfrom version 1.19.0 to 1.25.3 insrc/api/requirements.txtto support the latest authentication features.Imports and configuration:
ManagedIdentityCredentialand access the new settings where required. [1] [2] [3]These changes improve flexibility and security for Azure authentication, allowing the application to be deployed with either system-assigned or user-assigned managed identities as needed.## Purpose
Does this introduce a breaking change?
Golden Path Validation
Deployment Validation
What to Check
Verify that the following are valid
Other Information