[Storage] az storage blob allow empty blob with data - #33803
Open
Pan-Qi wants to merge 1 commit into
Open
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Collaborator
|
Thank you for your contribution! We will review the pull request and get back to you soon. |
Pan-Qi
force-pushed
the
bernard-allow-empty-blob-with-data
branch
from
July 28, 2026 13:39
1e9d047 to
046b63f
Compare
Pan-Qi
marked this pull request as ready for review
July 31, 2026 05:22
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes az storage blob upload --data '' so an explicitly empty --data value is treated as provided input (rather than being rejected as “missing”), enabling uploads of empty blobs via --data.
Changes:
- Updated
validate_upload_blobto detect “data was provided” vianamespace.data is not Noneinstead of truthiness checks. - Added unit tests covering empty/non-empty
--data,--file, mutual exclusivity errors, and missing input errors.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
src/azure-cli/azure/cli/command_modules/storage/_validators.py |
Adjusts upload input validation to allow empty-string --data while preserving mutual exclusivity and required-input checks. |
src/azure-cli/azure/cli/command_modules/storage/tests/latest/test_storage_validators.py |
Adds direct unit coverage for validate_upload_blob across expected valid/invalid input combinations. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
necusjz
approved these changes
Jul 31, 2026
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.
Related command
az storage blob upload
Description
Fix issue: #31852
Fixes
az storage blob upload --data ''so an explicitly empty data value is treated as provided input and can be used to upload an empty blob.The upload validator now checks whether
--datais omitted by comparing againstNone, instead of relying on truthiness. This preserves the existing validation for missing input and mutually exclusive--file/--dataarguments.Added unit test coverage for empty
--data, non-empty--data, file upload input, conflicting--fileand--data, and missing upload input.Testing Guide
History Notes
[Component Name 1] BREAKING CHANGE:
az command a: Make some customer-facing breaking change[Component Name 2]
az command b: Add some customer-facing featureThis checklist is used to make sure that common guidelines for a pull request are followed.
The PR title and description has followed the guideline in Submitting Pull Requests.
I adhere to the Command Guidelines.
I adhere to the Error Handling Guidelines.