简体   繁体   English

重新启动 Azure 应用服务时 dotnet.exe 无法启动

[英]dotnet.exe fails to start when restarting Azure app service

We have several Azure app services live and I've ran into a consistent problem when restarting any of them.我们有几个 Azure 应用程序服务,在重新启动其中任何一个时我都遇到了一致的问题。

We've right-click -> Published from Visual Studio upto an existing instance of an App Service which brings it online and functional immediately, we can update and republish new code without a problem, but restarting to app service from Azure Portal doesn't launch dotnet.exe .我们已右键单击 -> 从 Visual Studio 发布到应用服务的现有实例,使其立即联机并正常运行,我们可以毫无问题地更新和重新发布新代码,但从 Azure 门户重新启动应用服务不会启动dotnet.exe

When restarting or stopping/starting, the thread count instantly drops to 0 and continues to do nothing.重新启动或停止/启动时,线程数立即下降到 0 并继续无所作为。

I have to manually publish from VS again to reboot dotnet.exe .我必须再次从 VS 手动发布以重新启动dotnet.exe

I can see that dotnet.exe isn't an active process via Kudu -> Process Explorer , and manually publishing up to the App Service and then refreshing the Process Explorer list again shows that dotnet.exe is now an active process and the App Service begins to function as expected.我可以通过Kudu -> Process Explorer看到dotnet.exe不是一个活动进程,手动发布到应用服务然后再次刷新Process Explorer列表显示dotnet.exe现在是一个活动进程和应用服务开始按预期运行。

Is there a way to prevent this, or at the very least debug why it's happening?有没有办法防止这种情况发生,或者至少调试它发生的原因?

As it turns out this is being caused by silent failures, outside of error handling I'd put in place.事实证明,这是由静默故障引起的,在我实施的错误处理之外。 IIS would spin up the associated processes but dotnet would throw and error and "silently" die. IIS 会启动相关的进程,但dotnet会抛出错误并“悄悄地”死掉。

I use quotes because I'd failed to utilise Azure's indepth logging, which hid the error message from plain view until switched on.我使用引号是因为我没有使用 Azure 的深入日志记录,它在打开之前从普通视图中隐藏了错误消息。

For some basic debugging steps:对于一些基本的调试步骤:

  • Open up your Kudu console (Advanced Tools -> Go -> Debug Console) and navigate to LogFiles , open up eventlog.xml , the latest events are listed at the bottom.打开你的Kudu控制台(Advanced Tools -> Go -> Debug Console)并导航到LogFiles ,打开eventlog.xml ,最新的事件列在底部。

  • Run dotnet myDll.dll against your debug folder locally, where myDll.dll is the main dll in your project.针对本地debug文件夹运行dotnet myDll.dll ,其中myDll.dll是项目中的主dll This will typically throw the error causing dotnet to exit out, which wasn't obvious at design time.这通常会抛出导致dotnet退出的错误,这在设计时并不明显。

  • Ensure that your server-side appsettings.json (or the associated appsettings.[development/release].json contains the connection strings you're attempting to access.确保您的服务器端appsettings.json (或关联的appsettings.[development/release].json包含您尝试访问的连接字符串。

The errors that were occuring we'ren't due to design-time bugs, it generally fell over when trying to access run-time resources (such as appsettings ).我们发生的错误不是由于设计时错误,它通常在尝试访问运行时资源(例如appsettings )时appsettings

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 缺少Azure WebJob中的dotnet.exe - Missing dotnet.exe in Azure WebJob Azure Function 引用 Azure App Service 时无法启动 - Azure App Service fails to start when referenced by Azure Function Azure 应用服务容器不断重启 - Azure App Service Container keeps on restarting Azure App Service升级dotnet核心 - Azure App Service upgrade dotnet core 错误:C:\Program Files\do.net\do.net.exe 失败,返回代码:1 - Error: C:\Program Files\dotnet\dotnet.exe failed with return code: 1 进程 'C:\\hostedtoolcache\\windows\\dotnet\\dotnet.exe' 失败,退出代码为 1 - The process 'C:\hostedtoolcache\windows\dotnet\dotnet.exe' failed with exit code 1 应用服务重新启动时的服务 static htm - Service static htm when app service is restarting 为什么重新启动函数应用程序的 Azure 应用程序服务不会同步 azure 函数? - Why is restarting Azure app service of the function app not syncing the azure functions? 如何在 dotnet 应用中使用 Azure 应用服务的应用设置? - How to use the app settings of an Azure App Service in a dotnet app? 发布新的 dotnet 核心版本时,现有 Azure 应用服务实例是否会自动升级? - Are EXISTING Azure App Service Instances automatically upgraded when a new dotnet core version is released?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM