Skip to content

fix: Select Azure credentials by environment - #1043

Open
PrekshithD-Microsoft wants to merge 1 commit into
devfrom
psl-credentialuse
Open

fix: Select Azure credentials by environment#1043
PrekshithD-Microsoft wants to merge 1 commit into
devfrom
psl-credentialuse

Conversation

@PrekshithD-Microsoft

@PrekshithD-Microsoft PrekshithD-Microsoft commented Aug 10, 2026

Copy link
Copy Markdown

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_id setting. It also upgrades the azure-identity package for improved compatibility. The most important changes are grouped below:

Authentication logic updates:

  • Added an azure_client_id field to the Settings class in src/api/config.py, allowing configuration of a user-assigned managed identity. If left empty, the system-assigned identity is used.
  • Updated credential acquisition in AzureSearchDataSource, Azure Storage, and Queue Service modules to select DefaultAzureCredential in development and ManagedIdentityCredential (with optional client_id) in other environments. [1] [2] [3]

Dependency upgrades:

  • Upgraded azure-identity from version 1.19.0 to 1.25.3 in src/api/requirements.txt to support the latest authentication features.

Imports and configuration:

  • Updated imports to include ManagedIdentityCredential and 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?

  • Yes
  • No

Golden Path Validation

  • I have tested the primary workflows (the "golden path") to ensure they function correctly without errors.

Deployment Validation

  • I have validated the deployment process successfully and all services are running as expected with this change.

What to Check

Verify that the following are valid

  • ...

Other Information

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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_id to Settings for 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-identity from 1.19.0 to 1.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.

Comment thread src/api/modules/ingestion/queue_service.py
Comment thread src/api/modules/ingestion/azure_storage.py
Comment thread src/api/modules/data_sources/azure_search.py
Comment thread src/api/config.py
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants