Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

System.MissingMethodException in AzureBlobStorageProvider.RenameFile #7

Open
ghost opened this issue Apr 22, 2016 · 2 comments
Open

Comments

@ghost
Copy link

ghost commented Apr 22, 2016

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):

  1. Get old blob as a stream
  2. Create new blob using stream from Added snk to project to allow for use in signed solutions #1
  3. Delete old blob
@pofider
Copy link
Owner

pofider commented Apr 24, 2016

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.

@Dmitry-Me
Copy link

@pofider This downloads the data to your program and reuploads it. The new library has StartCopy()/StartCopyAsync()

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants