Skip to content

Fix container scope check for Blob Batch subrequests - #2891

Open
compiler-segfault (compiler-segfault) wants to merge 1 commit into
Azure:mainfrom
compiler-segfault:fix/blob-batch-container-scope
Open

compiler-segfault (compiler-segfault) wants to merge 1 commit into
Azure:mainfrom
compiler-segfault:fix/blob-batch-container-scope

Conversation

@compiler-segfault

Copy link
Copy Markdown

A container-scoped Blob Batch request accepted subrequests that target a sibling container whose name starts with the scope container's name: a batch scoped to logs also deleted a blob in logs-archive. Azure Storage requires each subrequest to apply to the container in the request URI and rejects the batch otherwise.

BlobBatchHandler.parseSubRequests compares the subrequest path with startsWith(), which matches at a character boundary rather than a path-segment boundary. The matched prefix now has to end at /; a service-level batch (empty prefix) still accepts every path.

Fixes #2884.

PR Branch Destination

  • PR targets main.

Always Add Test Cases

[x] New case in tests/blob/apis/blobbatch.test.ts: it creates containerX-archive next to the batch's container containerX, uploads a blob there and submits a container-scoped batch delete for that blob. Before the change the subrequest ran (subResponsesSucceededCount was 1 and the blob was gone); after it the batch reports a failed subrequest and the blob is still there. The whole file passes (17 tests), and npm run lint is clean.

Add Change Log

[x] ChangeLog.md has an entry under "Upcoming Release" → Blob.

A container-scoped batch accepted subrequests for sibling containers whose
name starts with the scope container's name, and executed them. Require the
matched prefix to end at a path separator.
Copilot AI balanced review requested due to automatic review settings November 6, 2026 09:53

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.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@compiler-segfault

Copy link
Copy Markdown
Author

@microsoft-github-policy-service agree

@compiler-segfault

Copy link
Copy Markdown
Author

CLA is signed now (license/cla passed), but the three workflow runs are still sitting in action_required, so Azurite PR check has not run yet. Could a maintainer approve the pending workflows when convenient?

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.

Container-scoped Blob Batch runs subrequests on another container whose name starts with the scope container's name

2 participants