Mel*_*hia 5 iis azure .net-core azure-web-app-service asp.net-core
我有部署在 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 的任何想法?
<?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>
Run Code Online (Sandbox Code Playgroud)
我使用 azure web app Scale out(应用服务计划)将正在运行的实例增加到 2。
我们通过将 startupTimeLimit 增加到 300 来解决这个解决方案
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<location>
<system.webServer>
<aspNetCore xdt:Transform="SetAttributes(startupTimeLimit)" startupTimeLimit="300">
</aspNetCore>
</system.webServer>
</location>
</configuration>
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
6877 次 |
| 最近记录: |