Skip to content

fix: Modified the code for default azure credential#237

Merged
Roopan-Microsoft merged 1 commit intomainfrom
sfi-code-fix
Oct 27, 2025
Merged

fix: Modified the code for default azure credential#237
Roopan-Microsoft merged 1 commit intomainfrom
sfi-code-fix

Conversation

@Prajwal-Microsoft
Copy link
Collaborator

@Prajwal-Microsoft Prajwal-Microsoft commented Oct 27, 2025

Purpose

  • ...
    This pull request refactors how Azure credentials are instantiated throughout the codebase. The main change is to create a single instance of DefaultAzureCredential and reuse it when initializing Azure SDK clients, rather than creating a new credential inline for each client. This makes the code more efficient and consistent.

Credential initialization refactor:

  • All occurrences of inline new DefaultAzureCredential(DefaultAzureCredential.DefaultEnvironmentVariableName) in client constructors are replaced by first creating a DefaultAzureCredential instance and then passing it to the client. This affects:
    • AzureStorageQueueService (AzureStorageQueueService.cs)
    • BlobServiceClient in StorageAccessUtil (StorageAccessUtil.cs)
    • DocumentAnalysisClient in AzureAIDocIntelEngine (AzureAIDocIntelEngine.cs)
    • SearchIndexClient in AzureAISearchMemory (AzureAISearchMemory.cs)
    • BlobServiceClient in AzureBlobsStorage (AzureBlobsStorage.cs)
    • AzureOpenAITextEmbeddingGenerationService in AzureOpenAITextEmbeddingGenerator (AzureOpenAITextEmbeddingGenerator.cs)
    • OpenAIClient in AzureOpenAITextGenerator (AzureOpenAITextGenerator.cs)
    • QueueClient in AzureQueuesPipeline (AzureQueuesPipeline.cs)

This change improves code readability, reduces duplication, and may help with credential caching and performance.

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

@Roopan-Microsoft Roopan-Microsoft merged commit d523303 into main Oct 27, 2025
3 checks passed
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