0
votes

I am trying to copy an mp4 file i have uploaded to blob storage that is associated with my media services account into an asset.Following the guide here Copy existing blob to media services asset The problem is i keep getting the same error every time the following

static public IAsset CreateAssetFromExistingBlobs(CloudBlobContainer mediaBlobContainer)
    {
        // Create a new asset. 
        IAsset asset = _context.Assets.Create("NewAsset_" + Guid.NewGuid(), AssetCreationOptions.None);

        ......
    }

I get the following exception message "An error occurred while processing this request."

with an inner exception" Access denied to storage account linked with Microsoft Azure Media Services account. Please ensure the storage credentials for this storage account is valid"

I have copied the keys from the portal so i cannot see what exactly is happening

2

2 Answers

0
votes

As i understand you rotated storage account keys and azure media services still trying to use old keys associated with storage account.

See Sync-AzureRmMediaServiceStorageKeys command https://azure.microsoft.com/en-us/documentation/articles/media-services-manage-with-powershell/.

This command will synchronize new storage account keys within your media service account. Hope it will help you.

0
votes

I have download the sample code and input my settings in App.config. Everything works fine.

Access denied to storage account linked with Microsoft Azure Media Services account. Please ensure the storage credentials for this storage account is valid"

From the following code:

            CloudBlobContainer blobContainer =
            UploadContentToStorageAccount(localMediaDir);

            // Create a new asset and copy the smooth streaming files into 
            // the container that is associated with the asset.
            IAsset asset = CreateAssetFromExistingBlobs(blobContainer);

We could find that the method UploadContentToStorageAccount(localMediaDir) will return a blobContainer. If we can upload the content to storage account, I think there will be no issue with the storage credentials. I would suggest create a new media service, link to a new storage account. Then try the same code to exclude code issue. If it is really related with your code, please share your changes to us.