gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-04 15:23:46 26 4
gpt4 key购买 nike

Windows Azure Management 管理门户中,当我尝试监视实例时,出现以下错误:

配置文件缺少一个或多个角色的诊断连接字符串。无法为这些角色启用监控。

我的服务有 2 个角色。

MyApp.Cache 在监控图上工作正常。

MyApp.Website 不显示监控图表。这就是为什么我不认为 value="UseDevelopmentStorage=true" 是问题所在。

我的服务配置如下:

<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>

我的服务定义是这样的:

<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>

最佳答案

为了使诊断正常工作,您需要在 .csdef 中导入诊断模块,并在 .cscfg 文件中提供有效的连接字符串。

就您而言,您已正确包含诊断模块,但您尚未在 .cscfg 文件中提供有效的连接字符串。您需要将“AccountName”替换为实际的帐户名称,将“AccountKey”替换为有效的帐户 key 。为此,您需要创建一个 Azure 存储帐户并在此处复制其连接字符串。

此外,即使这不是您问题的一部分,您也不应该在部署解决方案时使用“UseDevelopmentStorage=true”。它基本上使用本地存储模拟器作为 Azure 存储帐户,这在云中不可用。您还需要在辅助角色中提供有效的存储帐户连接字符串。

关于azure - Windows Azure - "The configuration file is missing a diagnostic connection string for one or more roles",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17087997/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com