Configuring Windows Azure to Store Diagnostic Information
Join the DZone community and get the full member experience.Join For Free
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, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.