Q:

Why .AsTableServiceQuery() Follows Continuation Token when theres $top in Azure Table Storage

I am using .AsTableServiceQuery() in Azure calls to get data.
I also use $top to get limited of data, lets say 100
The problem is, the query returns 100 results and it will also give x-ms-continuation-NextPartitionKey token.
And the same time .AsTableServiceQuery() does not care about theres already 100 results and following the Continuation Token until reaches the end of table. Which lots of data and lots of HTTP calls later, timeout.
Is there any other way to handle Continuation Token with $top filter

A:

The continuation tokens are a typical source of confusion. Whenever you issue a $filter or $top it's better to expect continuation token. The $top is another way of paginating over the table. Using the Linq Take(n) followed by .AsTableQuery() works the way you are expecting. Neil Mackenzie gives a nice sample in his very descriptive blog post about the same.
CloudTableQuery<Song> cloudTableQuery =
(from entity in tableServiceContext.CreateQuery<Song>(“Songs”)
 select entity).Take(10).AsTableServiceQuery<Song>();

