Reputation: 1
I am having problems while trying to configure Windows Azure Diagnostics in a PHP Web Role. I have read that I have to modificate the OnStart()
method in the WebRole.cs file, right? But the problem is that I don't find this file in my project. I don't have it! I thought that this file was created automatically, or, do I have to create it?
Upvotes: 0
Views: 139
Reputation: 2363
I don't think it's necessary to add any code to a WebRole.cs file (you won't have one in PHP).
However, you can set up diagnostics by adding the diagnostics module to your package. You can do this by modifying your ServiceDefinition.csdef (assuming you have one) to include the diagnostics module like this:
<ServiceDefinition name="xxx">
<WebRole name="xxx" vmsize="ExtraSmall">
<Imports>
<Import moduleName="Diagnostics" />
</Imports>
</WebRole>
</ServiceDefinition>
You then need to set the storage account that you want the diagnostics information written to, by modifying the ServiceConfiguration.cscfg to add a setting like this:
<ServiceConfiguration serviceName="xxx" osFamily="1" osVersion="*">
<Role name="xxx">
<Instances count="1" />
<ConfigurationSettings>
<Setting
name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString"
value="YOUR_STORAGE_CONNECTION_STRING" />
</ConfigurationSettings>
</Role>
</ServiceConfiguration>
You then need to add a diagnostics.wadcfg file to your package, which tells the diagnostics module how you would like the information captured. There is an example of one here: https://gist.github.com/2520279
Upvotes: 1