I am working with Azure SDK 2.5.1, mainly on the new designed diagnostics stuffs. However, I found I cannot get it run for my web role.
So, I created a cloud service project, added a web role. Then, I appended one Trace message at the end of Application_Start
in Global.asax.cs
:
Trace.TraceInformaction("Application_Start end.");
After that, I right clicked the WebRole and opened the Properties
tab. In the diagnostics config window:
- General: I choose
'Custom plan'
, also specified the storage account, keep the'Disk Quota in MB'
as default'4096'
- Application Logs:
'Log level'
switch to'All'
, others kept as default - Other tabs are in default config settings
After I deployed the project to cloud, I found some unexpected things:
- There is no
WADLogsTable
exists in Table storage. That's very strange, if I use a Worker Role, it would work as expected. So in web role, I just cannot find the Trace logging? - For the performance counters, since I am using the default config with 8 counters, I can only see 8 in
WADPerformanceCountersTable
table storage. In my assumption, over time, there would be more and more values of this 8 counters transferred to this table. But it was just not happened, after several hours, it still had that 8 counter values.
I just thought the diagnostics for Web Role just crashed or not working at all. Meanwhile, I checked the logs located at "C:\Logs\Plugins\Microsoft.Azure.Diagnostics.PaaSDiagnostics\1.4.0.0\DiagnosticsPlugin.log"
in server, at the end of this file there is an exception said some diagnostics process exit:
DiagnosticsPlugin.exe Error: 0 : [4/25/2015 5:38:21 AM] System.ArgumentException: An item with the same key has already been added.
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Microsoft.Azure.Plugins.Diagnostics.dll.PluginConfigurationSettingsProvider.LoadWadXMLConfig(String fullConfig)
DiagnosticsPlugin.exe Error: 0 : [4/25/2015 5:38:21 AM] Failed to load configuration file
DiagnosticsPlugin.exe Information: 0 : [4/25/2015 5:38:21 AM] DiagnosticPlugin.exe exit with code -105
From MSDN, the code -105
means:
The Diagnostics plugin cannot open the Diagnostics configuration file.
This is an internal error that should only happen if the Diagnostics plugin is manually invoked, incorrectly, on the VM.
It doesn't make sense, I did nothing to the VM.
As I said above, I just did very tiny changes to the scaffold code generated by Visual Studio 2013. Did I do something wrong or it's a bug for Azure SDK 2.5?
By the way, it seems everything is ok for Worker Role.