-
Notifications
You must be signed in to change notification settings - Fork 2
channel support #21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
channel support #21
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🧩 Analysis chain
🌐 Web query:
Azure SDK UploadAsync ContentHash Content-MD5 automatic computation persistence💡 Result:
Azure Storage does not “magically” persist an MD5 for every upload. What happens depends on which REST operation the SDK ends up using:
Put Blobrequest and you omitContent-MD5, the service generates an MD5 and it shows up later in blob properties / listings asContent-MD5. [2]Put Block/Put Block List), the service generally does not compute/persist a whole-blob MD5 for you; you must compute it client-side and set it explicitly (via the blob property headerx-ms-blob-content-md5/ SDK “content hash” header). [1]UploadAsyncin Azure SDK can switch between those paths. The .NET SDK’sUpload/UploadAsyncmay usePutBlobfor small uploads andPutBlock/PutBlockListfor larger uploads, so you can see “sometimes MD5 exists, sometimes it’s null” behavior unless you always set it yourself. [3]To persist an MD5 using the SDK, you must supply it (the SDK won’t reliably compute-and-store it for you across all upload strategies). For ADLS Gen2 / DataLake, this is done by setting
HttpHeaders.ContentHashin upload options. [5]Sources: Microsoft Learn REST
Put Blob(service MD5 behavior) [2]; Microsoft Q&A explanation of PutBlob vs PutBlock/PutBlockList MD5 persistence [1]; Azure SDK upload method behavior (PutBlob vs blocks) [3]; DataLakeUploadAsync+ContentHashexample [5].🌐 Web query:
Azure.Storage.Blobs BlobUploadOptions BlobHttpHeaders ContentHash documentation💡 Result:
In Azure.Storage.Blobs (.NET):
BlobUploadOptions.HttpHeaderslets you set standard blob HTTP headers (including content headers) as part of an upload. [1]BlobHttpHeaders.ContentHashis the blob’s MD5 (as abyte[]). If you specify it on upload, the service validates the transmitted content; if the MD5 doesn’t match, the request fails with HTTP 400 (Bad Request). [2]BlobProperties.ContentHashis returned (asbyte[]) when the blob has an MD5 and the response is for the full blob, so clients can validate integrity. [3]Example (upload with MD5 + content type):
Sources: [1] [2] [3]
🌐 Web query:
Azure Blob Storage UploadAsync automatically compute Content-MD5 hash💡 Result:
UploadAsyncin the Azure .NET v12 Blob SDK does not reliably/always compute and set the blob Content-MD5 for you.Upload/UploadAsyncmay upload as a single Put Blob for small payloads, but switches to Put Block / Put Block List for larger uploads. (azure.github.io)What to do (compute it yourself and set it on upload)
In
Azure.Storage.Blobs, setBlobHttpHeaders.ContentHash(MD5 bytes) viaBlobUploadOptions:(Equivalent tooling example: AzCopy/Storage Explorer “Put MD5” computes MD5 client-side and stores it to Content-MD5.) (learn.microsoft.com)
Citations:
Set ContentHash on upload to ensure hash persistence across all file sizes.
Azure's
UploadAsyncuses different strategies based on file size: singlePut Blobfor small uploads (auto-computes MD5) andPut Block/Put Block Listfor larger uploads (does not auto-persist MD5). Since the current code omitsContentHash, the hash comparison skip logic will only work for small files and fail inconsistently for large files.Move the hash calculation before the existence check and pass it via
BlobUploadOptions.HttpHeaders.ContentHashto ensure it's always persisted:🔧 Suggested fix
🤖 Prompt for AI Agents