Michael Collier serves as a Principal Cloud Architect for Aditi, a Microsoft NSI partner that focuses on cloud computing. . He is honored to be one of the first Windows Azure MVPs awarded by Microsoft and is a 2012 Windows Azure MVP of the Year for his extraordinary community contributions. Michael has had a successful 12-year career at various consulting and technology firms where he was instrumental in leading and developing solutions for a wide range of clients. He has a vast amount of experience in helping companies determine the best strategy for adopting cloud computing, and providing the insight, and hands-on experience to ensure they’re successful. Michael is also a respected technology community leader, and can often be found sharing his Windows Azure insights and experiences at regional and national conferences. Follow Michael’s experiences with Windows Azure on his blog at www.michaelscollier.com and on Twitter at @MichaelCollier Michael is a DZone MVB and is not an employee of DZone and has posted 22 posts at DZone. You can read more from them at their website. View Full User Profile

Configuring Windows Azure to Store Diagnostic Information

04.05.2012
| 1508 views |
  • submit to reddit

I was recently deploying a Windows Azure project where I used a different Windows Azure storage account for diagnostic data than for application data.  After publishing the project to Windows Azure I noticed the diagnostic data wasn’t showing up as expected – there was nothing in the storage account I set up to collect diagnostic data.  I checked the storage account for the application, and the diagnostic data was being collected there.

Well, that’s odd.  I checked the value of the ‘Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString’ connection string, and sure enough it was set to the storage account for the application, not the account I set for diagnostic data.

I had set the diagnostic connection string to use the ’findabathroomdiag’ storage account.

<Role name="FindABathroom.Web">
<Instances count="2" />
<ConfigurationSettings>
<Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=findabathroomdiag;AccountKey=b" />
<Setting name="DataConnectionString" value="DefaultEndpointsProtocol=https;AccountName=findabathroom;AccountKey=a"/>
  </ConfigurationSettings>
</Role>

I would then publish the project using the publishing wizard in Visual Studio.  In this wizard I would set the storage account to publish to ‘findabathroom’, the storage account for the application.

 

Looking at the ServiceConfiguration.cscfg file in the Windows Azure management portal I noticed the ‘Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString’ connection string was set to use ‘findabathroom’, and not ‘findabathroomdiag’ as I had expected.

What?  Somebody’s playing tricks on me!

No tricks.  I had forgotten about a change made to the Windows Azure tools for Visual Studio.  If you open up the properties for your Windows Azure role, go to the Configuration tab.  In the Diagnostics area you’ll find the “Use publish storage account as connection string when you publish to Windows Azure” check box.  This option is checked by default!

This little check box setting will cause Visual Studio to change your diagnostics connection string to match the connection string used during publishing of the application.

If you don’t want Visual Studio to change your diagnostics connection string, then be sure to uncheck that box!

Published at DZone with permission of Michael Collier, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)