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?
c# .net azure .net-core azure-blob-storage
add a comment |
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?
c# .net azure .net-core azure-blob-storage
1
This error would usually mean there’s an issue with the SAS token itself. Can you please share the code for generating the token? Also please share the SAS token (you can obfuscate the sig part of the token). Also, please share the complete code where this token is used.
– Gaurav Mantri
Nov 23 at 0:27
add a comment |
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?
c# .net azure .net-core azure-blob-storage
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?
c# .net azure .net-core azure-blob-storage
c# .net azure .net-core azure-blob-storage
asked Nov 22 at 22:29
idlackage
1,02251831
1,02251831
1
This error would usually mean there’s an issue with the SAS token itself. Can you please share the code for generating the token? Also please share the SAS token (you can obfuscate the sig part of the token). Also, please share the complete code where this token is used.
– Gaurav Mantri
Nov 23 at 0:27
add a comment |
1
This error would usually mean there’s an issue with the SAS token itself. Can you please share the code for generating the token? Also please share the SAS token (you can obfuscate the sig part of the token). Also, please share the complete code where this token is used.
– Gaurav Mantri
Nov 23 at 0:27
1
1
This error would usually mean there’s an issue with the SAS token itself. Can you please share the code for generating the token? Also please share the SAS token (you can obfuscate the sig part of the token). Also, please share the complete code where this token is used.
– Gaurav Mantri
Nov 23 at 0:27
This error would usually mean there’s an issue with the SAS token itself. Can you please share the code for generating the token? Also please share the SAS token (you can obfuscate the sig part of the token). Also, please share the complete code where this token is used.
– Gaurav Mantri
Nov 23 at 0:27
add a comment |
1 Answer
1
active
oldest
votes
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.
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53438660%2fable-to-upload-download-and-delete-but-not-list-in-azure-blob-container%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
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.
add a comment |
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.
add a comment |
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.
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.
answered Nov 23 at 21:56
idlackage
1,02251831
1,02251831
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53438660%2fable-to-upload-download-and-delete-but-not-list-in-azure-blob-container%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
This error would usually mean there’s an issue with the SAS token itself. Can you please share the code for generating the token? Also please share the SAS token (you can obfuscate the sig part of the token). Also, please share the complete code where this token is used.
– Gaurav Mantri
Nov 23 at 0:27