I am simply writing a json file to a Blob (please see my code below). I need it to be content = application/json but instead the blob json file reads "application/octet-stream" every time. I have set the blob.properties ContentType to = "application/json" but when I look in the Storage Explorer it says "application/octet-stream" every time.
static public void WriteBlob(string filename, string data) { string storageConnectionString = "DefaultEndpointsProtocol=https;AccountName=scadametrics;AccountKey=xxxxxxxxxxnfrsFRd/49Dmhn0HwKbxmpiA==;EndpointSuffix=core.windows.net"; var storageAccount = CloudStorageAccount.Parse(storageConnectionString); var client = storageAccount.CreateCloudBlobClient(); var container = client.GetContainerReference("azfunc-out");// string fileName = companyId.ToString() +"\\" + Guid.NewGuid(); var blob = container.GetBlockBlobReference(filename); blob.Properties.ContentType = "application/json"; using (CloudBlobStream x = blob.OpenWriteAsync().Result) { byte[] bytes = Encoding.ASCII.GetBytes(data); x.Write(bytes, 0, bytes.Length); x.Flush(); x.Close(); } }