Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Azure - "The configuration file is missing a diagnostic connection string for one or more roles"

In Windows Azure Management Management portal, when I try to monitor the instances, I get the following error:

The configuration file is missing a diagnostic connection string for one or more roles. Monitoring can't be enabled for these roles.

I have 2 roles on my Service.

MyApp.Cache works ok on the monitoring graphs.

MyApp.Website does not show monitoring graphs. This is why I don't thing that value="UseDevelopmentStorage=true" is the problem.

My Service configuration is as follows:

<Role name="MyApp.Website">
    <Instances count="2" />
    <ConfigurationSettings>      
      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="DefaultEndpointsProtocol=https;AccountName=AccountName;AccountKey=AccountKey" />      
    </ConfigurationSettings>
    </Role>
    <Role name="MyApp.Cache">
    <Instances count="2" />
    <ConfigurationSettings>
      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
      <Setting name="Microsoft.WindowsAzure.Plugins.Caching.NamedCaches" value="" />
      <Setting name="Microsoft.WindowsAzure.Plugins.Caching.Loglevel" value="" />
      <Setting name="Microsoft.WindowsAzure.Plugins.Caching.CacheSizePercentage" value="" />      
      <Setting name="Microsoft.WindowsAzure.Plugins.Caching.ConfigStoreConnectionString" value="DefaultEndpointsProtocol=https;AccountName=AccountName;AccountKey=AccountKey" />      
    </ConfigurationSettings>
</Role>

My Service Definition is this:

<ServiceDefinition name="MyApp.Azure" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-05.1.7">
  <WebRole name="MyApp.Website" vmsize="ExtraSmall">
    <Sites>
      <Site name="Web">
        <Bindings>
          <Binding name="Endpoint1" endpointName="Endpoint1" />
        </Bindings>
      </Site>
    </Sites>
    <Endpoints>
      <InputEndpoint name="Endpoint1" protocol="http" port="80" />
    </Endpoints>
    <Imports>
      <Import moduleName="Diagnostics" />
    </Imports>
    <LocalResources>
        <LocalStorage name="DiagnosticStore" sizeInMB="4096" cleanOnRoleRecycle="false"/>
    </LocalResources>    
  </WebRole>
  <WorkerRole name="MyApp.Cache" vmsize="ExtraSmall">
    <Imports>
      <Import moduleName="Diagnostics" />
      <Import moduleName="Caching" />
    </Imports>
    <LocalResources>
      <LocalStorage name="Microsoft.WindowsAzure.Plugins.Caching.FileStore" sizeInMB="4096" cleanOnRoleRecycle="false" />
    </LocalResources>
  </WorkerRole>
</ServiceDefinition>
like image 260
Dragos Durlut Avatar asked Jun 13 '13 13:06

Dragos Durlut


1 Answers

In order to make the diagnostics work, you need to import the diagnostics module in the .csdef and provide a valid connection string in the .cscfg file.

In your case, your have included the Diagnostics module correctly, however you have not provided a valid connection string in the .cscfg file. You need to replace the "AccountName" with an actual account name and the "AccountKey" with a valid account key. For that, you need to create an Azure storage account and copy its connection string here.

Also, even though it is not a part of your question, you should not use "UseDevelopmentStorage=true" while deploying the solution. It basically uses your local Storage Emulator as your Azure storage account, which is not available in cloud. You need to provide a valid storage account connection string in the worker role as well.

like image 73
Kunal Kapoor Avatar answered Oct 15 '22 15:10

Kunal Kapoor