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

1

6

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>
Utica answered 13/6, 2013 at 13:14 Comment(5)
What does your CSDEF file look like?Monocot
@Monocot Igorek, I have updated my question.Utica
Hmm... How are you deploying? are you checking the checkbox to update Diagnostic connection string with the storage account during publishing?Monocot
@Monocot Yes, I am checking the checkbox. The thing is the error doesn't always appear.Utica
I would try to replace the DevelopmentStorage string just in case to avoid possible replacement of that value issuesMonocot
P
4

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.

Pulverulent answered 17/7, 2013 at 6:31 Comment(1)
Thank you for your answer. Unfortunately, by the time I implemented the autoscaler, Azure included the autoscaler in their management portal.Utica

© 2022 - 2024 — McMap. All rights reserved.