fix(azure_blob): make AccountName optional when BlobEndpoint is provided#24663
Open
yoelk wants to merge 1 commit intovectordotdev:masterfrom
Open
fix(azure_blob): make AccountName optional when BlobEndpoint is provided#24663yoelk wants to merge 1 commit intovectordotdev:masterfrom
yoelk wants to merge 1 commit intovectordotdev:masterfrom
Conversation
This fixes a regression from v0.45.0 where AccountName was required even when BlobEndpoint was provided in the connection string. When BlobEndpoint is present but AccountName is missing, the account name is now extracted from the endpoint URL (e.g., from https://mystorageaccount.blob.core.windows.net/). This matches the behavior described in the code comments and restores backward compatibility with v0.45.0. Fixes: ENG-166496
|
@vectordotdev/vector could we get this PR merged? We've been unable to keep up with recent versions due to this issue. |
|
@thomasqueirozb are you able to help here? |
10 tasks
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.
Summary
This PR fixes a regression introduced in v0.52.0 where
AccountNamebecame required in Azure Blob Storage connection strings, even whenBlobEndpointwas provided. This broke existing configurations that relied on SAS tokens with blob endpoints.The fix:
BlobEndpointis provided butAccountNameis missing, the account name is now automatically extracted from the endpoint URLhttps://mystorageaccount.blob.core.windows.net/→ account name ismystorageaccountChanges made:
build_client()insrc/sinks/azure_common/config.rsto makeAccountNameoptional whenBlobEndpointis presentextract_account_name_from_endpoint()helper function to parse account names from blob endpoint URLsVector configuration
Connection string that was broken (now works):
Connection string that still works (unchanged):
How did you test this PR?
Added unit tests in
src/sinks/azure_common/config.rs:test_extract_account_name_from_endpoint- Tests URL parsing with various endpoint formatstest_build_client_with_account_name_in_connection_string- Tests traditional connection strings with explicit AccountNametest_build_client_with_blob_endpoint_and_account_name- Tests when both AccountName and BlobEndpoint are providedtest_build_client_with_blob_endpoint_without_account_name- Tests the regression fix - BlobEndpoint without AccountNametest_build_client_without_account_name_or_blob_endpoint- Tests proper error handlingVerified compilation with
cargo check -p vector --libChange Type
Is this a breaking change?
Does this PR include user facing changes?
no-changeloglabel to this PR.References
Notes
@vectordotdev/vectorto reach out to us regarding this PR.pre-pushhook, please see this template.make fmtmake check-clippy(if there are failures it's possible some of them can be fixed withmake clippy-fix)make testgit merge origin masterandgit push.Cargo.lock), pleaserun
make build-licensesto regenerate the license inventory and commit the changes (if any). More details here.