Disk UUIDs and Linux on Azure
I recently ran a few tests to figure out how UUIDs behave on Azure when we capture VM Images, copy VHDs, move Virtual Machines and re-provision them in different data centers. Continue Reading…
I recently ran a few tests to figure out how UUIDs behave on Azure when we capture VM Images, copy VHDs, move Virtual Machines and re-provision them in different data centers. Continue Reading…
There are many scenarios where filtering on partial RowKeys makes sense. One of these scenarios is Azure Diagnostics Log analysis where events are partitioned by time based PartitionKeys and by compound RowKeys. This allows us to filter and find information effectively.
Event RowKeys are composed of deployment IDs, role names, instance names, categories and other information:
8637d014bcf94452a1e48f393a11674b___Brisebois.WorkerRole___Brisebois.WorkerRole_IN_0___0000000001652031520___WADLogsLocalQuery
The following example, shows how to target a specific table partition and filter events based on a StartsWith pattern.
var storageAccount = Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(connectionString); var client = storageAccount.CreateCloudTableClient(); var table = client.GetTableReference("WADLogsTable"); // Querying Windows Azure Diagnostics by Partition for a partial RowKey var query = new FindWithinPartitionStartsWithByRowKey("0635204061600000000", "8637d014bcf94452a"); var result = query.Execute(table);
Logging in Windows Azure can be done through Windows Azure Diagnostics. This solution collects a ton of detailed data that can be hard to parse through. I recently needed a close to real-time trace of what my Roles were doing. My current project has many instances with many independent services running in parallel, resulting in a challenge when I try to trace using Windows Azure Diagnostics. Log4Net and Enterprise Library offer amazing tools to accomplish what I’m after. But they do so with so much detail and data, that we often need to resort to parsing tools and third party applications to extract meaningful information. I needed something quick, lightweight and that didn’t cost too much to operate.
At first, I was trying to follow what my instances were up to using the Windows Azure Compute Emulator. This wasn’t what I was looking for, because local environments don’t run exactly like the production or staging environments on the cloud. I spent a few minutes thinking about logging and costs related to Windows Azure Storage transactions and came up with the solution described below.
The code from this Post is part of the Brisebois.WindowsAzure NuGet Package
To install Brisebois.WindowsAzure, run the following command in the Package Manager Console
PM> Install-Package Brisebois.WindowsAzure
A sample project containing the log viewer can be found on GitHub repository ”Windows Azure Logger” .