Is there any number limitation in Azure Storage Table query entities?

0 votes

I found this in MSDN:

A query against the Table service may return a maximum of 1,000 entities at one time and may execute for a maximum of five seconds.

But as I wrote a sample to show this issue, I didn't find any limitations for the number of returned entities, here is my key code:

public class DataProvider
{
    public static string PartitionKey
    {
        get { return "PartitionKey"; }
    }

    public static IEnumerable<CustomerEntity> MoreThanThousandData()
    {
        var result = new List<CustomerEntity>();
        for (int i = 0; i < 1200; i++)
        {
            result.Add(new CustomerEntity(PartitionKey, Guid.NewGuid().ToString())
            {
                Name = Guid.NewGuid().ToString(),
                Age = new Random().Next(10, 70)
            });
        }

        return result;
    }
}

Insert 1200 entities to the table:

public class AfterOptimize
{
    public void InsertDataToTable()
    {
        var cloudData = DataProvider.MoreThanThousandData();
        Console.WriteLine("Plan to insert {0} entities to the table.", cloudData.Count());

        InsertDataToTableInternal(AzureTableService.Table, cloudData);
    }

    private void InsertDataToTableInternal(CloudTable table, IEnumerable<ITableEntity> data)
    {
        var splitedData = data.Chunk(100);
        Parallel.ForEach(splitedData, item =>
        {
            var batchInsertOperation = new TableBatchOperation();
            foreach (var tableEntity in item)
            {
                batchInsertOperation.Add(TableOperation.Insert(tableEntity));
            }

            table.ExecuteBatch(batchInsertOperation);
        });
    }
}

Then, read from the table, the partition key are all the same here:

public void ReadCloudData()
{
    InsertMoreThanOneThousandDataToTable();
    var query =
        new TableQuery<CustomerEntity>().Where(TableQuery.GenerateFilterCondition("PartitionKey",
            QueryComparisons.Equal, DataProvider.PartitionKey));
    var result = AzureTableService.Table.ExecuteQuery(query);
    Console.WriteLine("Read {0} entities from table.", result.Count()); // output 1200
}

I only used the latest Azure storage .NET client API.

Jul 4 in Azure by sabby
• 4,350 points
46 views

1 answer to this question.

0 votes
ExecuteQuery method handles continuation token internally and will return all entities in a table. Thus, the behavior you're seeing is correct. If you run Fiddler when you are executing this code, you will notice multiple requests are sent to table service. First request would be without continuation token but in subsequent requests you will see NextPartitionKey and NextRowKey querystring parameters.
answered Jul 4 by Perry
• 17,020 points

Related Questions In Azure

0 votes
1 answer

Is there a logical difference between WebApp and API app in Azure?

Basically there was only minute differences between ...READ MORE

answered Apr 26, 2018 in Azure by null_void
• 3,220 points
51 views
0 votes
1 answer

Quering all the rows in Azure table Storage.

Refer the following code: var acc = new ...READ MORE

answered Apr 12 in Azure by Prerna
• 1,940 points
33 views
0 votes
1 answer

Is there a way to get ERROR details on Azure website?

You have two options: First, you can turn ...READ MORE

answered May 25, 2018 in Azure by club_seesharp
• 3,450 points
204 views
0 votes
1 answer

How to determine the number of messages in an Azure Services Bus Queue?

You will get error when you try ...READ MORE

answered Jun 12, 2018 in Azure by null_void
• 3,220 points
311 views
0 votes
1 answer

Azure has 3 different types of storage accounts. Is there any major difference between them?

Azure Storage provides three types of storage ...READ MORE

answered Mar 4 in Azure by Prerna
• 1,940 points
589 views
0 votes
1 answer

How to check if multiple files exist in Azure container?

foreach loop is the most efficient way though. ...READ MORE

answered Mar 4 in Azure by Prerna
• 1,940 points
267 views
0 votes
1 answer

How to install Windows Azure Storage Emulator?

There may be an issue with the ...READ MORE

answered Mar 6 in Azure by Prerna
• 1,940 points
341 views
0 votes
1 answer

Azure Storage Emulator shows error.

This blog might help with your query: http://blog.smarx.com/posts/windows-azure-storage-emulator-the-process-cannot-access-the-file-because-it-is-being-used-by-another-process Also, ...READ MORE

answered Mar 15 in Azure by Prerna
• 1,940 points
164 views
0 votes
1 answer

Is it possible to access performance counter in Microsoft Azure Web App?

No, it is not supported on Azure ...READ MORE

answered Jul 4 in Azure by Perry
• 17,020 points
38 views
0 votes
1 answer

How to create a sub-container in Azure?

You can create a container named "content" and ...READ MORE

answered Jun 28 in Azure by Perry
• 17,020 points
92 views