dotnet / dotnet/arcade

Helix json objects uploaded to Azure blob storage aren't stored with the correct content type

Open
#16,254 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
729
Forks
397
Avg merge
3d 15m
Merged PRs (30d)
149

Description

- [ ] This issue is blocking
- [ ] This issue is causing unreasonable pain

I use a browser extension to pretty print json documents and to make embedded urls into hyperlinks so they are navigatable. This allows me to easily view helix job json documents. Some documents don't provide the correct content-type and trigger the browser to download a json document to my downloads folder. For example, when looking at a helix job, there is a JobList item in the json, which is a link to a json document stored in azure blob storage. When navigating to this document, the headers returned by Azure blob storage have the Content-Type as `application/octet-stream`, which triggers saving the json document to disk.

Documentation for the headers [can be found here](https://learn.microsoft.com/en-us/rest/api/storageservices/set-blob-properties?tabs=microsoft-entra-id#request-headers-all-blob-types). Setting the `x-ms-blob-content-type` header to `application/json; charset=utf-8` will allow the document to be loaded and viewed in the browser. If you're using the Azure SDK, there's a `BlobHttpHeaders.ContentType` [property you can use instead](https://learn.microsoft.com/en-us/dotnet/api/azure.storage.blobs.models.blobhttpheaders?view=azure-dotnet).

An example file (which may not be valid by the time this is potentially worked on) is https://helixd1107v0xdeko0k025g8.blob.core.windows.net/helix-job-c6c8a107-0e2d-483b-b370-5da59cc7b9eaa2e0dc1131f4d33a8/job-list-cee87970-4abd-4562-8e3c-0750c4c3a237.json?helixlogtype=result

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.