So, Microsoft decided to send diagnostic data to Azure table storage. I'm trying to query this storage and send it to another location for analytics via C# SDK. I can query just fine pull the hundreds of thousand of record, but it appears that the last continuation token they send will always receive a null response. Even if more data gets sent into table storage, my continuation token doesn't work, still gets a null continuation token and null data back.
Has anyone done anything like this? How can I continue "syncing" azure table data if the continuation tokens they send are broken?
public static List<PerfMonEntity> GetEventData(ref TableContinuationToken contToken)
{
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"]);
CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
CloudTable eventLogsTable = tableClient.GetTableReference("WADPerformanceCountersTable");
TableQuery<PerfMonEntity> query = new TableQuery<PerfMonEntity>();
var l = new List<PerfMonEntity>();
var segment = eventLogsTable.ExecuteQuerySegmented(query, contToken ?? new TableContinuationToken());
foreach (PerfMonEntity wadCounter in segment)
{
l.Add(wadCounter);
}
contToken = segment.ContinuationToken;
if (contToken == null)
{
Console.WriteLine("contToken is NULL!");
return null;
}
Console.WriteLine("partkey: {0}", contToken.NextPartitionKey ?? "");
Console.WriteLine("rowkey: {0}", contToken.NextRowKey ?? "");
return l;
}
-=-=-=-=-=-
while (num < loop)
{
List<PerfMonEntity> eleList = AzurePerfTable.GetEventData(ref contToken);
if (eleList != null)
returnedList.AddRange(eleList);
else
num = loop;
num += 1;
if (contToken != null)
AZContinuationToken.SetContToken(contToken);
Console.WriteLine("returnedlistsize: {0}", returnedList.Count<PerfMonEntity>());
}