Search code examples
azure-storageazure-blob-storage

pointers for REST API To access or list files in the blob storage container


I'm very new to microsoft azure. I have been given the task to list all the files in the azure blob storage container. Below are the details which i'm having for the task

i'm having below details:

Storage Account - accdevtesthw

Storage account type - blob

Container Name - Students

Folders - Marks & Details

Storage Account key -

Please let me know how to get the REST URL to list all the files in Marks folder in my container.

i tried with below URL, but failed with the error mentioned

https://accdevtesthw.blob.core.windows.net/Students/Marks?comp=list

error:

<Error>
        <Code>InvalidQueryParameterValue</Code>
        <Message>
        Value for one of the query parameters specified in the request URI is invalid. RequestId:90a650f3-601e-008e-62b3-e3ab45000000 Time:2019-03-26T09:06:07.8146066Z
        </Message>
        <QueryParameterName>comp</QueryParameterName>
        <QueryParameterValue>list</QueryParameterValue>
        <Reason/>a
        </Error>

I want to know how to frame RESTURL with the details i have been given


Solution

  • I had the same issue. I solved it by adding the 'prefix' parameter in the Uri. In your case I think you need:

    https://accdevtesthw.blob.core.windows.net/Students?comp=list&prefix=Marks
    

    from: https://learn.microsoft.com/en-us/rest/api/storageservices/list-blobs#uri-parameters