Note that there are some explanatory texts on larger screens.

plurals
  1. POCopying a Azure Blob and injecting in azure media services gives System.Data.Services.Client.DataServiceQueryException
    primarykey
    data
    text
    <p>for Ingesting assets to Media Services from another blob storage account, Followed the steps <a href="http://social.msdn.microsoft.com/Forums/en-US/MediaServices/thread/9bcaf96d-3a47-4e76-8c95-3bd9200ba432" rel="nofollow">http://social.msdn.microsoft.com/Forums/en-US/MediaServices/thread/9bcaf96d-3a47-4e76-8c95-3bd9200ba432</a> My code is : </p> <pre><code>CloudStorageAccount storageAccount = Microsoft.WindowsAzure.CloudStorageAccount.Parse(RoleEnvironment.GetConfigurationSettingValue("AzureStorageString")); private static readonly string _accountName = ConfigurationManager.AppSettings["accountName"]; private static readonly string _accountKey = ConfigurationManager.AppSettings["accountKey"]; </code></pre> <hr> <pre><code> public ActionResult UploadData(IEnumerable&lt;HttpPostedFileBase&gt; files) { CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient(); CloudBlobContainer blobContainer = blobClient.GetContainerReference("rawvideos"); if (blobContainer.CreateIfNotExist()) { blobContainer.SetPermissions(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob }); } CloudMediaContext _context = new CloudMediaContext(_accountName, _accountKey); Guid g = Guid.NewGuid(); IAsset assetToBeProcessed = _context.Assets.CreateEmptyAsset("YourAsset_" + g.ToString(), AssetCreationOptions.None); IAccessPolicy writePolicy = _context.AccessPolicies.Create("Policy For Copying", TimeSpan.FromMinutes(30), AccessPermissions.Write | AccessPermissions.List); ILocator destinationLocator = _context.Locators.CreateSasLocator(assetToBeProcessed, writePolicy, DateTime.UtcNow.AddMinutes(-5)); CloudBlobContainer sourceContainer = blobContainer; CloudBlobContainer destinationContainer= blobClient.GetContainerReference("rawvideocopy"); if (destinationContainer.CreateIfNotExist()) { blobContainer.SetPermissions(new BlobContainerPermissions { PublicAccess = BlobContainerPublicAccessType.Blob }); } foreach (var file in files) { CloudBlockBlob rawVideoFileRef= blobContainer.GetBlockBlobReference(file.FileName); rawVideoFileRef.UploadFromStream(file.InputStream); CloudBlob sourceFileBlob = sourceContainer.GetBlobReference(file.FileName); sourceFileBlob.FetchAttributes(); long sourceLength = sourceFileBlob.Properties.Length; CloudBlob destinationFileBlob= destinationContainer.GetBlobReference(file.FileName); destinationFileBlob.CopyFromBlob(sourceFileBlob); destinationFileBlob.FetchAttributes(); long destLength = destinationFileBlob.Properties.Length; assetToBeProcessed.Publish(); assetToBeProcessed = RefreshAsset(_context,assetToBeProcessed); } return View(); } </code></pre> <hr> <p>assetToBeProcessed.Publish(); gives an error :</p> <pre><code> System.Data.Services.Client.DataServiceQueryException was unhandled by user code HResult=-2146233079 Message=An error occurred while processing this request. Source=Microsoft.Data.Services.Client InnerException: System.Data.Services.Client.DataServiceClientException HResult=-2146233079 Message=&lt;?xml version="1.0" encoding="utf-8" standalone="yes"?&gt;&lt;error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"&gt;&lt;code&gt;Internal Server Error&lt;/code&gt;&lt;message xml:lang="en-US"&gt;Asset has no files uploaded.&lt;/message&gt;&lt;innererror&gt;&lt;message&gt;Asset has no files uploaded.&lt;/message&gt;&lt;type&gt;System.ArgumentException&lt;/type&gt;&lt;stacktrace&gt; at Microsoft.Cloud.Media.Vod.Rest.Data.Repository.AssetRepository.InitMainFile(IDataStore dataStore, AssetRecord asset) in d:\Builds\100\IISMediaServices\Release_Official\Sources\Nimbus\Release\src\Vod\Rest\Data\Repository\AssetRepository.cs:line 346&amp;#xD; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload