简体   繁体   中英

Able to upload, download, and delete but not list in Azure Blob Container

I have a service in C# where I try to list all the files in a directory.

CloudBlobDirectory dir = container.GetDirectoryReference(path);
var res = await dir.ListBlobsSegmentedAsync(continuationToken); <-- Error is thrown on this line

I have confirmed that the directory exists, that the path is correct, and that it has files in it.

However, I'm getting this error: The requested URI does not represent any resource on the server.

I am accessing the blob with a SAS key that has all permissions (read, write, delete, list). Listing files works perfectly fine when I use the storage emulator, but not when I'm connected to an actual azure resource. What could be the issue?

Turns out I can only list when I have account-level access, instead of container-level like what I had before. I generated a new SAS key off the Azure portal, for https://<accountname>.blob.core.windows.net/ instead of https://<accountname>.blob.core.windows.net/<containername> , and was able to list. I have no idea why as this wasn't written in the docs anywhere.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM