REST API Not Returning Blobs within Container

cdues 20 Reputation points
2023-07-14T16:16:35.8733333+00:00

I am actually using LabVIEW with their NI Cloud Toolkit for Azure but I believe this is based on the REST API.

The HTTP request it sends out when I request a list of all blobs within a container is similar to: https://storage_account.blob.core.windows.net/container_name_here?comp=list&restype=container

It sometimes returns all the blobs, sometimes returns some of the blobs, and sometimes returns no blobs. The timing between these three scenarios is usually on the scale of hours. Usually, all the blobs are returned but recently it has become frequent that no blobs are returned.

My container only has 3 blobs so it shouldn't have a problem with there being too many.

The returning body of the HTTP Get looks like:

<?xml version="1.0" encoding="utf-8"?><EnumerationResults ServiceEndpoint="https://storage_account.blob.core.windows.net/" ContainerName="container_name_here"><Blobs /><NextMarker>2!68!MDAwMDAsIUxSUDAwNjUhMDAwMDI4ITE2MDEtMDEteDFUMDA6MDA6HDAuMDAwMDABgFoh</NextMarker></EnumerationResults>

Is this related to pagination?

The LabVIEW Toolkit doesn't have a pagination option unfortunately so I would have to make some custom code. But I don't understand why I would be getting a pagination token when I didn't get any of the blob names in the first request.

I'm inexperienced in xml, but it looks like the

<Blobs />

means no blobs exist. I know for a fact that the blobs exist because I can log into the Azure Portal and see the blobs in the container.

Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,141 questions
{count} votes

Accepted answer
  1. Sumarigo-MSFT 47,526 Reputation points Microsoft Employee
    2023-07-17T15:24:28.0666667+00:00

    @cdues Firstly, Apologies for the delay response! I am check on your query!

    The behavior you are experiencing with the Azure Blob Storage REST API and LabVIEW's NI Cloud Toolkit is likely related to pagination. The XML response you provided indicates that the <Blobs /> element is empty, which typically means that no blobs were returned in the current page of results. The <NextMarker> element contains a token that you can use to retrieve the next page of results.

    Pagination is a common mechanism used in APIs to manage large result sets by dividing them into smaller pages. It allows you to retrieve a limited number of results at a time and navigate through the complete result set using the provided markers or tokens.

    In your case, if you are not receiving any blob names in the first request and the <Blobs /> element is empty, it suggests that the response might be paginated, and the first page you received is empty. To retrieve all the blobs, you would need to make subsequent requests using the pagination token provided in the <NextMarker> element.

    Try to modify your LabVIEW code to handle pagination. After the initial request, you should check if the <Blobs /> element is empty and if a <NextMarker> is provided. If so, make another request using the pagination token to retrieve the next page of results. Repeat this process until you have retrieved all the blobs.

    You can extract the pagination token (NextMarker) from the XML response and include it as a parameter in subsequent requests. This will help you retrieve the remaining blobs and ensure you get a complete list.

    By implementing pagination in your code, you should be able to retrieve all the blobs from the Azure Blob Storage container consistently, regardless of the size of the result set.

    Looking forward for your reply!


0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.