Skip to content

fix: Support Azure backend for dataset files (HEXA-1781) - #416

Merged
bramj merged 5 commits into
mainfrom
fix-azure-headers
Aug 21, 2026
Merged

fix: Support Azure backend for dataset files (HEXA-1781)#416
bramj merged 5 commits into
mainfrom
fix-azure-headers

Conversation

@bramj

@bramj bramj commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Note: I tested the main logic in the workspace copier script (where we duplicate this; not ideal, we'll look into refactoring later)

Two issues:

  • Extra header required for uploading files into a dataset
  • Max limit of 5GiB when doing a single PUT. Since files in a dataset can be larger, we need to support upload in blocks when the backend is on Azure (GCS does not have this issue)

Changes

  • Add Azure-specific headers when adding files to datasets: Azure's Put Blob REST API requires the header x-ms-blob-type: BlockBlob on every blob-creating PUT. We didn't send this, resulting in error: 400 MissingRequiredHeader — An HTTP header that's mandatory for this request is not specified.
  • Azure has a hard limit on 5GiB for a single file upload PUT. Since dataset files can be larger, we need to do them block per block to avoid hitting the limit. This implements this to upload in 64MiB blocks.

bramj added 5 commits August 21, 2026 09:45
to datasets.

Azure's Put Blob REST API requires the header x-ms-blob-type: BlockBlob on every blob-creating PUT.
We didn't send this, resulting in error:
400 MissingRequiredHeader — An HTTP header that's mandatory for this request is not specified.
Azure has a hard limit on 5GiB for a single file upload PUT. Since
dataset files can be larger, we need to do them block per block to avoid
hitting the limit.

This implements this to upload in 64MiB blocks.
@bramj
bramj marked this pull request as ready for review August 21, 2026 11:54
@bramj
bramj requested a review from yolanfery August 21, 2026 12:02

@yolanfery yolanfery 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.

Good catch 🤯 and still crazy to me to see this type of fix being produced in such a short timeframe 😛

Comment on lines +238 to +248
mutation generateDatasetUploadUrl ($input: GenerateDatasetUploadUrlInput!) {
generateDatasetUploadUrl(input: $input) {
uploadUrl
headers
success
errors
}
}
""",
{"input": {"versionId": self.id, "contentType": content_type, "uri": filename}},
)

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.

Out of scope but those could become part of our typed SDK client

@bramj
bramj merged commit 3f64679 into main Aug 21, 2026
6 checks passed
@bramj
bramj deleted the fix-azure-headers branch August 21, 2026 12:36
@blsqbot blsqbot mentioned this pull request Aug 21, 2026
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.

2 participants