Accessing Windows Azure Diagnostics Logs With LINQPad
If you are using Windows Azure Diagnostics with the DiagnosticMonitorTraceListener
you will most likely have a table in your storage account called WADLogsTable with a ton of data in it. It can be a bit overwhelming.
A colleague and I wanted to get two simple pieces of information: an event’s date and the corresponding message. Furthermore, we only wanted events that had happened today. Here’s what we came up with using LINQPad and the Azure Storage Driver.
First, make sure you’re using a table storage account as your database. In my case, my connection is called mycloudstorageaccount
.
Then simply perform your query. If you want to copy/paste, here’s the text version:
from l in WADLogsTable where l.PartitionKey.CompareTo(DateTime.Today.Ticks.ToString("d19")) > 0 select new { DateTime = new DateTime(l.EventTickCount.Value), l.Message }
Oh, and don’t forget to check out the SQL
tab if you are interested in the “low level stuff.” It will show the actual URL that was used to query Windows Azure.
Comments:
Mauricio Diaz Orlich - Sep 5, 2014
I haven’t used Azure logs in a while, so maybe the name of the table changed. Isn’t there a table in your list with a similar name?
Mauricio Diaz Orlich - Oct 5, 2014
Hi, the plugin uses the Azure SDK to query all tables for the specified account. It does not filter them in any way. I don’t currently have access to an account that uses Azure Diagnostics so I cannot it try it myself. Does the plugin show all other tables present in the account?
Comp - Sep 0, 2014
Hello, I could not access the local WADLog table. I have - wadlogs table with log entries (Azure Management Studio shows them). - storage account is correct because the Tables part is appears in LinqPad - Im using the Azure Storage Driver of course - but I get the following The name ‘WADLogsTable’ does not exist in the current context Do I need something additional to access the Diagnostic part besides the Tables ? Thanks in advance. Comp.
Comp - Sep 2, 2014
Hello Diaz, Since then I noticed that, LinqPad doesn’t shows the ‘WADLogsTable’ in the table list, but its exists according to Azure Storage Management Studio. Did you have the same situation as well ?