AzureBlobFileSystem
AzureBlobFileSystem copied to clipboard
System.MissingMethodException in AzureBlobStorageProvider.RenameFile
Calling the method AzureBlobFileSystem.AzureBlobStorageProvider.RenameFile results in System.MissingMethodException. Using AzureBlobFileSystem, Version=0.0.7.0.
Using WindowsAzure.Storage Version=7.0.0 (see: https://www.nuget.org/packages/WindowsAzure.Storage), the method CloudBlockBlob.StartCopyFromBlob(Microsoft.WindowsAzure.Storage.Blob.CloudBlockBlob, Microsoft.WindowsAzure.Storage.AccessCondition, Microsoft.WindowsAzure.Storage.AccessCondition, Microsoft.WindowsAzure.Storage.Blob.BlobRequestOptions, Microsoft.WindowsAzure.Storage.OperationContext) is Obsolete, see: https://msdn.microsoft.com/en-us/library/azure/microsoft.windowsazure.storage.blob.cloudblockblob.startcopyfromblob.aspx
An alternative pattern for performing Blob Rename (unoptimized):
- Get old blob as a stream
- Create new blob using stream from #1
- Delete old blob
I see, StartCopyFromBlob is obsolete now.
With the latest azure storage sdk, we need to do something like
using (var stream = await sourceBlob.OpenReadAsync())
{
await destinationBlob.UploadFromStreamAsync(stream);
}
Don't you want to try clone this repo and make a PR with fix? It would be very much appreciated.
@pofider This downloads the data to your program and reuploads it. The new library has StartCopy()/StartCopyAsync()