Tracing in Microsoft Azure Cloud Service

Setting Up the Tracing

Since it took me some time to figure out again what to do to see the tracing output of my Microsoft Azure Worker Role in a Cloud Service, here are some hints.

First, read How To Enable Diagnostics in a Cloud Service. Following the step-by-step description solves most of the issues. I think it’s worth mentioning that there is no need to do any coding to enable tracing when following these steps. One just have to add the tracing messages themselves to the code.

Then, I created a new Cloud Service and a new Storage Account in the Microsoft Azure Management portal.

Before publishing the Cloud Services, I changed the size of the VM from the default value “Small” to “ExtraSmall” in the ServiceDefinition.csdef file. This size fits for testing purposes and is way cheaper.

After publishing the service to Windows Azure, I had to adjust the diagnostics settings manually. No idea why Azure was not using the settings of the config files – maybe I missed some. I used the Server Explorer of Visual Studio. Just right-click on the role node in the Windows Azure / Cloud Services tree, and make sure to take the proper deployment slot (production or staging). Then select Update Diagnostics Settings… and set the required values of the Application logs tab page.

Diagnostic Settings

Accessing the Output

To access the output, I use the Server Explorer of Visual Studio too. There is no need to install third-party tool for this.

The trace output can be found under the Storage node. Find the Storage Account created for the Cloud Service and open the Tables node. There should be a WADLogsTable item. If not, check all steps described by How To Enable Diagnostics in a Cloud Service and if you have updated the diagnostics settings. Double-clicking the WADLogsTable item will open the table containing the trace output.

Links

How To Enable Diagnostics in a Cloud Service

Take Control of Logging and Tracing in Microsoft Azure (a little bit outdated, but still helpful)

Azure Execution Models (describes and compares Azure Virtual Machines, Web Sites and Cloud Services)

3 thoughts on “Tracing in Microsoft Azure Cloud Service”

  1. Most examples of Azure diagnostic configuration will likely show the imperative, code-first approach to configuring the diagnostic agent. Why? Because it s quick and relatively easy to understand. Plus, configuration via code was how Microsoft first showed developers how to configure Azure diagnostics.

  2. I appreciate, cause I found just what I was looking for. You have ended my 4 day long hunt! God Bless you man. Have a nice day. Bye

Leave a Comment

Please note that every comment requires the admin's approval before it will be published.

Any comment containing spam like "... great topic. Feel free to visit my web page ..." will be deleted. So please do not waste your and our time by leaving such comments.

We respect your privacy. When you leave a comment, your IP address will not be recorded by WordPress.