Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8504041
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T01:55:05+00:00 2026-06-11T01:55:05+00:00

for Ingesting assets to Media Services from another blob storage account, Followed the steps

  • 0

for Ingesting assets to Media Services from another blob storage account, Followed the steps
http://social.msdn.microsoft.com/Forums/en-US/MediaServices/thread/9bcaf96d-3a47-4e76-8c95-3bd9200ba432
My code is :

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"];

    public ActionResult UploadData(IEnumerable<HttpPostedFileBase> 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();
        }

assetToBeProcessed.Publish();
gives an error :

 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=<?xml version="1.0" encoding="utf-8" standalone="yes"?><error xmlns="http://schemas.microsoft.com/ado/2007/08/dataservices/metadata"><code>Internal Server Error</code><message xml:lang="en-US">Asset has no files uploaded.</message><innererror><message>Asset has no files uploaded.</message><type>System.ArgumentException</type><stacktrace>   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&#xD;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T01:55:07+00:00Added an answer on June 11, 2026 at 1:55 am

    You need to get the URL for the destinationFileBlob from your destinationLocator.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've followed Rails 3.1 on Heroku Cedar tutorial, as well as another half a
I want to play movie from assets-library. I get a ALAsset from camera roll,
64-bit VISTA Python 3.1 from urllib import request a = request.urlopen('http://www.marketwatch.com/investing/currency/CUR_USDYEN').read(20500) b = a[19000:20500]
Inserting rows one by one from a 600 record data-set is taking almost an
When inserting copy into an HTML document I get from sources such as word
I'm loading HTML-formatted content into my app from a web service, then plugging that
I'm writing a search engine in C#, retrieving rows from a SQL database. I'd
I am trying to choose an image randomly from a sub directory inside my
When I do git push heroku master I get...... mkdir -p /tmp/build_klvg6evbve3x/public/assets mkdir -p
I am planning to build a RIA about a year from now (when my

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.