MAINT: Use DefaultAzureCredential directly for blob storage auth#1946
Open
adrian-gavrila wants to merge 1 commit into
Open
MAINT: Use DefaultAzureCredential directly for blob storage auth#1946adrian-gavrila wants to merge 1 commit into
adrian-gavrila wants to merge 1 commit into
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
df1755a to
9aaa2ef
Compare
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
Swaps the Azure user-delegation SAS flow in
AzureBlobStorageIOandAzureBlobStorageTargetfor directDefaultAzureCredentialdata-plane auth. The explicit SAS-token path is untouched in both classes; only the no-token path changes.This is a simplification, not an RBAC reduction.
Storage Blob Data Contributoralready includes thegenerateUserDelegationKeyaction, so the required built-in role is unchanged. What it drops is the per-call delegation-key round-trip and SAS minting, so the container client just authenticates with the caller's Entra identity directly. That removes the dependency ongenerateUserDelegationKey(relevant for minimal custom roles) and one Entra round-trip per client.AzureBlobStorageIOnow also closes the credential alongside its container client via a new_close_client_asynchelper.Supersedes #1615 (closed, went stale vs
main) and additionally coversAzureBlobStorageTarget, which answers the parity question raised on that PR.Tests and Documentation
tests/unit/models/test_storage_io.pyandtests/unit/prompt_target/target/test_prompt_target_azure_blob_storage.pycovering both auth paths and credential cleanup. All pass, pre-commit clean.AzureBlobStorageIOagainst a storage account usingDefaultAzureCredential.AzureBlobStorageTargethas no client-close lifecycle today (its container client was never closed either), so the credential isn't closed. Tracked separately rather than adding a dispose pattern here.