Search code examples
c#.netazurevideo-processingazure-media-services

Azure Media Services (v3) blob storage, assets, and locators backup


I'm trying to figure out how to backup videos produced by Azure Media Services.

Where are the assets and streaming locators stored, how to backup them or recreate them for existing binary files stored in the Azure Media Service's blob storage?

Proposed solution:

I've come up with a solution, once the video is processed by transformation job, the app will create a copy of the container to separate backup blob storage. Since, from my understanding, the data produced by transformation jobs are immutable, I don't have to manage another synchronization.

if (job.State == JobState.Finished)
{
  StreamingLocator locator = await AzureMediaServicesService.CreateStreamingLocatorAsync(client, azureMediaServicesConfig, outputAssetName, locatorName);
  var videoUrls = await AzureMediaServicesService.GetVideoUrlsAsync(client, azureMediaServicesConfig, locator.Name);
  // backup blobs in creted container here
}

Are only the binary data stored in blob storage sufficient for restoring the videos successfully? After restore, will the already existing streaming and download links work properly?

Since, when I'm creating locators, I'm passing the asset name as well, I reckon I should backup asset's data too. Can/should I somehow backup assets and locators? Where are they stored? Is there any better way to backup videos?

I was looking for the answers here: https://learn.microsoft.com/en-us/azure/media-services/latest/streaming-locators-concept https://learn.microsoft.com/en-us/azure/media-services/latest/stream-files-tutorial-with-api#get-a-streaming-locator https://learn.microsoft.com/en-us/azure/media-services/latest/limits-quotas-constraints


Solution

  • Part of what you're asking is 'What is an asset in Media Services?'. The Storage container that is created as part of the encoding process is definitely a good portion of what you need to backup. Technically that is all you need to recreate an asset from the backup Storage account. Well, if you don't mind recreating the other aspects of the asset.

    An asset is/can be several things:

    • The Storage container and the contents of that container. These would include the MP4 video files, the manifests (.ism and .ismc), and metadata XML files.
    • The published locator or URL where clients make GET requests to the streaming endpoint.
    • Metadata. This includes things like the asset name, creation date, description, etc.

    If you keep track of the Storage container in your backup and what metadata is associated with it as well as have a way of updating your site with a new streaming locator then all you really need is the Storage container for recreating the asset.