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, 2019 in Azure by sabby
• 4,370 points
2,607 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.

Hope it helps!

To know more about Azure, join Azure course today.

Thank you!!

answered Jul 4, 2019 by Perry
• 17,100 points

Related Questions In Azure

0 votes
0 answers

Is there any way for accessing the pipeline in Azure VM

I want to know like I have ...READ MORE

Sep 22, 2020 in Azure by nidhi
• 120 points
562 views
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 27, 2018 in Azure by null_void
• 3,220 points
1,200 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, 2019 in Azure by Prerna
• 1,960 points
4,847 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, 2019 in Azure by Prerna
• 1,960 points
26,813 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, 2019 in Azure by Prerna
• 1,960 points
3,853 views
0 votes
1 answer

How to install Windows Azure Storage Emulator?

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

answered Mar 7, 2019 in Azure by Prerna
• 1,960 points
2,794 views
0 votes
1 answer

Azure Storage Emulator shows error.

Check if you are running BitTorrent/uTorrent or similar ...READ MORE

answered Mar 16, 2019 in Azure by Prerna
• 1,960 points
1,712 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, 2019 in Azure by Perry
• 17,100 points
1,013 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, 2019 in Azure by Perry
• 17,100 points

edited Oct 7, 2021 by Sarfaraz 1,957 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP