question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to copy a blob from NFSv3-enabled storage account

See original GitHub issue

Query/Question I try to copy a blob from a storage account that has NFSv3 enabled.

            var source = "https://source.blob.core.windows.net/container1/file1.bin?sv=2020-10-02&st=2021-11-23T08%3A53%3A18Z&se=2021-12-01T08%3A53%3A00Z&sr=b&sp=r&sig=8Bt3I1guQe0VXjMjeOGOhPHv5tS2%2BH8gpx00bWhCnnE%3D";
            var target = "https://target.blob.core.windows.net/container2/file2.bin?sv=2020-08-04&st=2021-11-23T08%3A54%3A13Z&se=2021-12-01T08%3A54%3A00Z&sr=c&sp=racwl&sig=WZULxHkbM6yo4s%2FIw%2FKH7UNpaf4AQVxnhxIUGq0nv88%3D";

            var blobClient = new Azure.Storage.Blobs.BlobClient(new Uri(target));
            var result = await blobClient.StartCopyFromUriAsync(new Uri(source));

The operation fails. Diagnostic logs show the following error:

StatusCode
409

OperationName
GetBlockList

StatusCode
409

StatusText
BlobOperationNotSupportedForBlobCreatedByNfsV3

I can download the blob without an issue:

            var blobClient = new Azure.Storage.Blobs.BlobClient(new Uri(source));
            await blobClient.DownloadToAsync(@"C:\Temp\MyFile");

Also, azcopy copy works fine.

.\azcopy_windows_amd64_10.12.2\azcopy.exe" copy 'source' 'target'

How can I copy the blob without downloading and re-uploading?

Environment:

  • Azure.Storage.Blobs 12.10.0
.NET SDK (reflecting any global.json):
 Version:   5.0.403
 Commit:    bf9d168ac2

Runtime Environment:
 OS Name:     Windows
 OS Version:  10.0.19043
 OS Platform: Windows
 RID:         win10-x64
 Base Path:   C:\Program Files\dotnet\sdk\5.0.403\

Host (useful for support):
  Version: 5.0.12
  Commit:  7211aa01b3

It happens only for blobs created by NFS. I can copy blobs created using the storage SDK without an issue.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:16 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
amnguyecommented, Nov 23, 2021

Okay I see what’s happening now. Obviously Copy Blob, e.g. StartCopyFromUri is not supported by NFSv3 currently.

The reason azcopy (and storage explorer since it also uses azcopy) works is because they’re using Put Blob From Url. In order to do copies with NFSv3. the API needs to change to using Put Blob From Url

The SDK API to call this method is BlockBlobClient.SyncUploadFromUri. Please use this one instead.

0reactions
AntonZiminSaritasacommented, Nov 24, 2021

@amnguye Thank you! It works.

            var sourceUri = new Uri("https://source.blob.core.windows.net/sourcecontainer/tenant7/file3.txt?sv=2020-10-02&st=2021-11-23T22%3A41%3A37Z&se=2021-12-01T22%3A41%3A00Z&sr=b&sp=r&sig=xxxx");
            var destUri = new Uri("https://target.blob.core.windows.net/targetcontainer/file1644.txt?sv=2020-08-04&st=2021-11-23T08%3A54%3A13Z&se=2021-12-01T08%3A54%3A00Z&sr=c&sp=racwl&sig=xxxx");

            var blockBlobClient = new Azure.Storage.Blobs.Specialized.BlockBlobClient(destUri);
            var result = await blockBlobClient.SyncUploadFromUriAsync(sourceUri);
Read more comments on GitHub >

github_iconTop Results From Across the Web

Network File System 3.0 support for Azure Blob Storage
This support provides Linux file system compatibility at object storage scale and prices and enables Linux clients to mount a container in Blob...
Read more >
How To Copy Files From One Azure Storage Account ...
To copy an entire account data from one blob account with SAS to another blob account with SAS, you can use the following...
Read more >
Using NFS with Azure Blob Storage
To do this, open Control Panel, navigate to Programs and Features, Click on Turn Windows features on or off, then find the Services...
Read more >
NFS 3.0 support for Azure Blob Storage
In this video, we introduce Azure Blob NFS 3.0 support, the only public cloud object storage offering native file system compatibility.
Read more >
409 API is not yet supported for NFSv3 enabled accounts
Issue mitigated by copy to another blob storage without NFSv3 enabled.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found