Azure Quick Tasks -Enabling Azure Diagnostics via Configuration

As my customers started moving to Azure PaaS, I started getting a lot of questions about enabling logging and tracing in Azure. So usual way to enable and trace out of Azure PaaS currently is provided via WAD (Windows Azure Diagnostics).  There are lots of articles on this subject, goal here is to show you how to quickly enable this feature via diagnostics.wadcfg, i.e. via configuration.

Assuming you are working in Visual Studio, in your solution just right click on WebRole or Worker Role you are working with and pick properties that would open where you can turn on logging (it will enable it in config)


That underneath writes a file called diagnostics.wadcfg with configuration. This is what I have in my example in it:

<?xml version=”1.0″ encoding=”utf-8″?>
<DiagnosticMonitorConfiguration configurationChangePollInterval=”PT1M” overallQuotaInMB=”4096″ xmlns=””>
<DiagnosticInfrastructureLogs />
<IISLogs container=”wad-iis-logfiles” />
<CrashDumps container=”wad-crash-dumps” />
<Logs bufferQuotaInMB=”1024″ scheduledTransferPeriod=”PT1M” scheduledTransferLogLevelFilter=”Verbose” />
<WindowsEventLog bufferQuotaInMB=”1024″ scheduledTransferPeriod=”PT1M” scheduledTransferLogLevelFilter=”Verbose”>
<DataSource name=”Application!*” />
<PerformanceCounters bufferQuotaInMB=”512″ scheduledTransferPeriod=”PT0M”>
<PerformanceCounterConfiguration counterSpecifier=”\Memory\Available MBytes” sampleRate=”PT3M” />
<PerformanceCounterConfiguration counterSpecifier=”\Web Service(_Total)\ISAPI Extension Requests/sec” sampleRate=”PT3M” />
<PerformanceCounterConfiguration counterSpecifier=”\Web Service(_Total)\Bytes Total/Sec” sampleRate=”PT3M” />
<PerformanceCounterConfiguration counterSpecifier=”\ASP.NET Applications(__Total__)\Requests/Sec” sampleRate=”PT3M” />
<PerformanceCounterConfiguration counterSpecifier=”\ASP.NET Applications(__Total__)\Errors Total/Sec” sampleRate=”PT3M” />
<PerformanceCounterConfiguration counterSpecifier=”\ASP.NET\Requests Queued” sampleRate=”PT3M” />
<PerformanceCounterConfiguration counterSpecifier=”\ASP.NET\Requests Rejected” sampleRate=”PT3M” />

Note above that I am picking up certain perfmon counters, event logs , IIS logs and even crash dumps.  That is setting in Diagnostics area in Config screen above.

This is what I have in my in my app.config, meaning there is a Listener entry:




<add type=”Microsoft.WindowsAzure.Diagnostics.DiagnosticMonitorTraceListener, Microsoft.WindowsAzure.Diagnostics, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35″


<filter type=”” />





If you have configured Diagnostics as per screen above you will note that it automatically will create WadLogs table for you where traces will go.


WAD automatically maps the wad-crash-dumps, wad-frq, and wad-iis containers to special folders which only exist in web and worker roles.  For VM roles comment out the CrashDumps, FailedRequestLogs, and IISLogs elements.

Finally, there are the various “QuotaInMB” settings.  WAD automatically allocates 4096 MB of local storage named DiagnosticStore.  WAD fails if the overallQuotaInMB value is set higher than the local storage allocated or if the various “QuotaInMB” values add up to within about 750 MB of overallQuotaInMB.  Either:

  • Decrease some of the “QuotaInMB” values until the config works.


  • Add a LocalStorage setting named DiagnosticStore to ServiceDefinition.csdef and increase overallQuotaInMB.

For more I recommend –,

Hope this was useful.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s