Skip to content

[Storage] Disable decompression on download when using crc64#47553

Open
jalauzon-msft wants to merge 5 commits into
Azure:mainfrom
jalauzon-msft:crc-disable-compression
Open

[Storage] Disable decompression on download when using crc64#47553
jalauzon-msft wants to merge 5 commits into
Azure:mainfrom
jalauzon-msft:crc-disable-compression

Conversation

@jalauzon-msft

Copy link
Copy Markdown
Member

Content validation with CRC64 using structured message for download which, due to the extra data in the payload to encode the checksums, cannot work with auto-decompression. This change disables decompression when using CRC64 and produces errors if users try to opt into it. This is not a breaking change because the options auto and crc64 have not released yet.

Copilot AI review requested due to automatic review settings June 18, 2026 00:41
@github-actions github-actions Bot added the Storage Storage Service (Queues, Blobs, Files) label Jun 18, 2026

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.

Pull request overview

This PR updates Azure Storage download APIs to prevent automatic response decompression from interfering with CRC64 (structured message) content validation by forcing decompression off for CRC64 validation and erroring when users explicitly request decompression.

Changes:

  • Added runtime guards to disable decompress for CRC64 validation and raise ValueError when decompress=True is explicitly requested (Blob + File Share).
  • Updated docstrings across Blob, File Share, and Data Lake to document the CRC64/decompression incompatibility and the required ext-checksums extra.
  • Centralized the Blob behavior via _download_blob_options, implicitly covering Data Lake downloads that delegate to the internal blob client.

Reviewed changes

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

Show a summary per file
File Description
sdk/storage/azure-storage-file-share/azure/storage/fileshare/aio/_file_client_async.py Enforces decompress=False for CRC64 validation and raises on decompress=True; updates docs.
sdk/storage/azure-storage-file-share/azure/storage/fileshare/_file_client.py Sync equivalent of the CRC64/decompression guard; updates docs.
sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/aio/_data_lake_file_client_async.py Doc update to reflect CRC64/decompression incompatibility for Data Lake downloads.
sdk/storage/azure-storage-file-datalake/azure/storage/filedatalake/_data_lake_file_client.py Doc update to reflect CRC64/decompression incompatibility for Data Lake downloads.
sdk/storage/azure-storage-blob/azure/storage/blob/aio/_blob_client_async.py Doc update to reflect CRC64/decompression incompatibility for Blob downloads.
sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client.py Doc update to reflect CRC64/decompression incompatibility for Blob downloads.
sdk/storage/azure-storage-blob/azure/storage/blob/_blob_client_helpers.py Implements the Blob-side CRC64/decompression guard in _download_blob_options.

Comment thread sdk/storage/azure-storage-file-share/tests/test_content_validation_async.py Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Storage Storage Service (Queues, Blobs, Files)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants