Skip to content

Instantly share code, notes, and snippets.

@JeffreyCA
Created May 13, 2020 13:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeffreyCA/d5c544df36a0f61737f8a435f897de5e to your computer and use it in GitHub Desktop.
Save JeffreyCA/d5c544df36a0f61737f8a435f897de5e to your computer and use it in GitHub Desktop.
Enable media streaming on Azure Blob
using System;
using Microsoft.WindowsAzure.Storage;
namespace EnableStreaming
{
class Program
{
static async System.Threading.Tasks.Task Main(string[] args)
{
var storageAccount = CloudStorageAccount.Parse("DefaultEndpointsProtocol=....");
var blobClient = storageAccount.CreateCloudBlobClient();
// Get the current service properties
var serviceProperties = await blobClient.GetServicePropertiesAsync();
// Set the default service version to 2011-08-18 (or a higher version like 2019-07-07)
serviceProperties.DefaultServiceVersion = "2019-07-07";
// Save the updated service properties
await blobClient.SetServicePropertiesAsync(serviceProperties);
Console.WriteLine("Done");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment