Why Azure Diagnostics SDK 2.8 doesn’t work in Azure fabric
Recently I deployed one of the webservice into Azure cloud, and since logging are important, I enabled Azure Diagnostics on my service configuration so that I can monitor my service anytime without any hassle.
I’m using Azure SDK 2.8.2 on my development, and Azure runtime in my VM are currently using 2.7. Before I upload it into the cloud, I tested it on my local emulator to see if diagnostics works.
To check if it works is really simple. You just need to take a look in your storage, and make sure there are some tables created in your Table Storage

And after I make sure everything works fine, I finally deploy it into the cloud, but….
My storage in the cloud was empty, even though I tried to invoke my service several times, but there’s still no Tables nor Blob created.

After researching on some documentation on Azure Diagnostics, finally I got the answers (which I find it quite weird)
“If we package the deployment files and upload it using Azure Portal, by default Azure Diagnostics will not run”
Well… I’ve spent the whole week to figure this answer 🙁
The reason is because Diagnostics configuration must be applied separately after deployment – Because Azure SDK version 2.5 uses the extension model, the diagnostics extension and configuration are no longer part of the deployment package and must be applied separately after the deployment (as written in here: https://msdn.microsoft.com/en-us/library/azure/dn873976.aspx)
So, in order for the Diagnostics can run in Azure Fabric, there are two solutions:
1. If you Package your deployment file + upload it via Azure Portal, you need to enable the diagnostics manually using Azure Power Shell
OR, there’s a simple way….
2. Just publish it using Microsoft Visual Studio!

but why????
Because Visual Studio will apply the extension and configuration for you when you use the Publish wizard to deploy your application.
Well, I hope you guys don’t fall into the same pit as me, and maybe Microsoft may put the Deployment process more streamlined.
Leave a Reply