title: Cannot stream content using Azure Media Services when CDN enabled
body: <p>I am trying to get on demand streaming of videos setup with Azure Media Services. </p>
  
  <p>So far I can upload, transcode and stream videos using an "OnDemandOrigin" locator. </p>
  
  <p>My current understanding, based on the documentation I have read is that I should just be able to activate the CDN and use the same URL to then access the streaming content via the CDN. </p>
  
  <p>Unfortunately, I am getting 404's when using the same locator URL with the CDN enabled and I don't understand why.</p>
  
  <p>The code I am using to create the locator is as follows: </p>
  
  <pre><code>var asset = Context.Assets.Where(a =&gt; a.Id == assetId).FirstOrDefault();
  if (asset == null)
  {
      throw new ArgumentException("Could not find assetId: " + assetId);
  }
  
  var accessPolicy = Context.AccessPolicies.Create(string.Format("View '{0}' - {1:yyyy-MM-ddTHH:mm:ssZ}", asset.Id,  DateTime.UtcNow), sasDuration, AccessPermissions.Read);
  var locator = Context.Locators.CreateLocator(LocatorType.OnDemandOrigin, asset, accessPolicy, DateTime.UtcNow.AddMinutes(-5));
  
  var streamingSasUrl = string.Format("{0}/{1}/{2}/manifest", locator.BaseUri.Remove(0, 5), locator.ContentAccessComponent, asset.GetManifestAssetFile().Name);
  </code></pre>
  
  <p>Can anybody point me in the right direction?</p>