I'm trying to copy a video file from the local azure storage, to a remote storage in C#, to be able to encode it using Azure Media Services.
After retrieving the blobs for the copy using the StartCopy method, I get a 404 NOT FOUNT exception returned.
destinationBlob.StartCopy(new Uri(sourceBlob.Uri.AbsoluteUri + signature));
The value of sourceBlob.Uri.AbsoluteUri
is a local Uri (http://127.0.0.1/ params)
I would expect the copy to be executed but instead I get a 404 Error.
This example allows you to pass in a Task to this function which accepts the Stream as an object to deal with. You will need to adjust the utils.GetBlockBlobReference to point to your actual blob reference. This method opens the stream for Wtire, you may also need one that opens a stream for reading. I've different providers for reading/writing to storage.
public async Task Use(string pointer, Func<System.IO.Stream, Task> useAction)
{
if (useAction == null)
{
throw new ArgumentNullException(nameof(useAction));
}
var blobRef = await utils.GetBlockBlobReference(storageFactory, pointer);
using (var cloudStream = await blobRef.OpenWriteAsync())
{
await useAction(cloudStream);
}
}