【发布时间】:2020-03-25 11:06:33
【问题描述】:
我有部署在 Azure Web 应用程序服务中的 .NET Core 3.1 API。由于错误 500.37 ANCM Failed to Start Within Startup Time Limit,我在 Azure 中运行应用程序时遇到了问题。我设法通过增加 web.config 中的 startupTimeLimit 来解决这个问题(如下所示)。
但是现在,当我在 Azure Web 应用服务中运行 2 个实例时。其中一个实例运行良好,但另一个实例仍然存在相同的错误。
关于如何在 IIS 中为多个实例设置 startupTimeLimit 的任何想法?
web.config
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<!-- To customize the asp.net core module uncomment and edit the following section.
For more info see https://go.microsoft.com/fwlink/?linkid=838655 -->
<system.webServer>
<httpProtocol>
<customHeaders>
<remove name="X-Powered-By" />
</customHeaders>
</httpProtocol>
<handlers>
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModuleV2" resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet" arguments=".\Clients.Api.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" startupTimeLimit="180" hostingModel="inprocess" >
</aspNetCore>
</system.webServer>
</configuration>
编辑:
我使用 azure web app Scale out (App Service plan) 将运行实例增加到 2。
【问题讨论】:
-
Azure 中有什么服务?虚拟机还是应用服务?
-
@LexLi Azure 应用服务使用 Azure 资源管理器。
-
你的意思是你使用azure web app scale out来增加运行实例?据我所知,每个实例都将使用相同的 web,config 文件。
-
@BrandoZhang 是的。我编辑了我的帖子
-
正如我所说,两个 azure Web 应用程序实例都将使用相同的 web.config。我猜这个问题也和startupTimeLimit的值有关,第二个instance比instance1耗时,建议你可以尝试增加startupTimeLimit再试一次。
标签: azure asp.net-core iis .net-core azure-web-app-service