These two posts looked promising:
How upload blob in Azure Blob Storage with specified ContentType with .NET v12 SDK?
Uploading blockblob and setting contenttype
But in both, they are using different libraries. (Why are there so many?) As mandated by powers out of my control, we are using BlobContainerClient. And within that class, we are using the UploadBlobAsync method.
public async Task<string> UploadAsync(string fileName, byte[] file, string containerName)
{
...
BlobContainerClient container = await createContainerIfNotExistsAsync(containerName);
using Stream stream = file.ToStream();
var result = await container.UploadBlobAsync(fileName, stream); // <-- does the upload.
...
}
By default, the type is set to application/octet-stream. How can I override this?