Skip to content

Change character validation in tag key to align with server behavior - #2581

Merged
Akanksha Jain (jainakanksha-msft) merged 2 commits into
Azure:mainfrom
EmmaZhu:tag_multi_words
Aug 17, 2026
Merged

Change character validation in tag key to align with server behavior#2581
Akanksha Jain (jainakanksha-msft) merged 2 commits into
Azure:mainfrom
EmmaZhu:tag_multi_words

Conversation

@EmmaZhu

Copy link
Copy Markdown
Contributor

Thanks for contribution! Please go through following checklist before sending PR.

PR Branch Destination

  • For Azurite V3, please send PR to main branch.
  • For legacy Azurite V2, please send PR to legacy-dev branch.

Always Add Test Cases

Make sure test cases are added to cover the code change.

Add Change Log

Add change log for the code change in Upcoming Release section in ChangeLog.md.

Development Guideline

Please go to CONTRIBUTION.md for steps about setting up development environment and recommended Visual Studio Code extensions.

@SamPersson

Sam Persson (SamPersson) commented Oct 27, 2025

Copy link
Copy Markdown

It seems the failing test is correct: key111==value1 should still result in http status 400

If tag names are regular SQL identifiers, they may be present without escaping; if they contain any special characters, they must be delimited with double quotes (e.g. "TagName" = 'TagValue').

(https://learn.microsoft.com/en-us/rest/api/storageservices/specifying-conditional-headers-for-blob-service-operations#tags-predicate-syntax)

So I guess it needs separate validation for double quote delimited tag keys, and only then allow +-./:=

CopilotAI 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.

Pull request overview

This PR updates Azurite’s blob tag filter condition parsing to accept quoted tag keys with a broader set of characters, aligning the emulator’s behavior with Azure Storage server behavior. It also adds test coverage and a changelog entry for the behavior change.

Changes:

  • Allow quoted tag keys to include spaces and specific special characters when parsing tag filter conditions.
  • Add tests covering quoted keys with special characters and an additional invalid-key scenario.
  • Document the behavior change in ChangeLog.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

FileDescription
tests/blob/apis/blob.test.tsAdds tests for quoted tag keys containing special characters and another invalid header case.
src/blob/persistence/QueryInterpreter/QueryParser.tsUpdates tag key validation to permit a wider character set when the key is quoted.
ChangeLog.mdAdds an entry describing the new quoted-key behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment threadtests/blob/apis/blob.test.ts
Comment threadChangeLog.md Outdated

CopilotAI 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.

Pull request overview

Copilot reviewed 3 out of 3 changed files in this pull request and generated no new comments.

CopilotAI 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.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@jainakanksha-msft
Akanksha Jain (jainakanksha-msft) merged commit 6e4efed into Azure:mainAug 17, 2026
44 of 45 checks passed
Sign up for freeto 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.

4 participants

@EmmaZhu@SamPersson@jainakanksha-msft