Search code examples
c#azureazure-media-services

How can I set a max. ExpirationDate TimeSpan on a azure Media Service Locator?


I mistakenly set the wrong time for several Locator Url's that are connected to uploaded videos. I am now trying to correct by setting the locator to a MaxValue to ensure that it does not go away, as several others have already. I tried to do the following, context.Locators.Create(LocatorType.OnDemandOrigin, outputAsset, AccessPermissions.Read, TimeSpan.MaxValue), and this only resulted in "The added or subtracted value results in an un-representable DateTime". What is the Maximum timespan I can possibly set if I really do not want the locators to expire?


Solution

  • You could set as 100 years as the expiryOn time, it should be sufficient.