title: Azure table Storage continuation
body: <p>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. </p>
  
  <p>Has anyone done anything like this? How can I continue "syncing" azure table data if the continuation tokens they send are broken?</p>
  
  <pre><code>           public static List&lt;PerfMonEntity&gt; GetEventData(ref TableContinuationToken contToken)
      {
          CloudStorageAccount storageAccount = CloudStorageAccount.Parse(ConfigurationManager.AppSettings["StorageConnectionString"]);
          CloudTableClient tableClient = storageAccount.CreateCloudTableClient();
          CloudTable eventLogsTable = tableClient.GetTableReference("WADPerformanceCountersTable");
          TableQuery&lt;PerfMonEntity&gt; query = new TableQuery&lt;PerfMonEntity&gt;();
  
          var l = new List&lt;PerfMonEntity&gt;();
          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;
      }
  </code></pre>
  
  <p>-=-=-=-=-=-</p>
  
  <pre><code>        while (num &lt; loop)
          {
              List&lt;PerfMonEntity&gt; 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&lt;PerfMonEntity&gt;());
          }
  </code></pre>