FIX: Use DefaultAzureCredential directly for blob storage auth#1615
Open
adrian-gavrila wants to merge 4 commits intomicrosoft:mainfrom
Open
FIX: Use DefaultAzureCredential directly for blob storage auth#1615adrian-gavrila wants to merge 4 commits intomicrosoft:mainfrom
adrian-gavrila wants to merge 4 commits intomicrosoft:mainfrom
Conversation
Replace the user delegation SAS token flow with direct DefaultAzureCredential authentication. This removes the need for the Storage Blob Delegator role - Storage Blob Data Contributor is now sufficient for blob operations. The SAS token path is preserved for callers who explicitly provide one. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
- Store DefaultAzureCredential on self and close it via _close_client_async helper - Replace all inline client close/reset blocks with _close_client_async calls - Update auth error message to reflect direct credential flow - Fix existing test that patched removed AzureStorageAuth.get_sas_token - Add new test for DefaultAzureCredential path when no SAS token provided Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jsong468
reviewed
Apr 15, 2026
| if not self._sas_token: | ||
| logger.info("SAS token not provided. Creating a delegation SAS token using Entra ID authentication.") | ||
| sas_token = await AzureStorageAuth.get_sas_token(self._container_url) | ||
| if self._sas_token: |
Contributor
There was a problem hiding this comment.
curious: how come we don't need to make a similar change to AzureBlobStorageTarget?
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.
Description
Replaces the user delegation SAS token flow in
AzureBlobStorageIOwith directDefaultAzureCredentialauthentication. Thisremoves the requirement for the Storage Blob Delegator RBAC role — Storage Blob Data Contributor is now sufficient.
The explicit SAS token path is preserved.
AzureStorageAuthis still used byAzureBlobStorageTargetand is unaffected.Tests and Documentation
test_storage_io.pypass (updated existing test, added 2 new tests)airtstorageaccountprodwith only Storage Blob Data Contributor