Azure ASP .net WebApp-500错误-请求超时 [英] Azure ASP .net WebApp - 500 Error - The request timed out
问题描述
我目前正在尝试通过托管在azure上的web应用程序(该数据存储在xlsx文件中)导入数据库中的数据.
I am currently trying to import data in my database through my webapp, which is hosted on azure (the data is stored in an xlsx file).
我遇到的问题是,即使在脱机工作时导入过程像超级按钮一样,azure也会在每次大约4分钟后给我一个服务器超时错误.
The problem I have is that azure gives me a server time out error after around 4 minutes everytime, even though the import process works like a charm when I am working offline.
确切的错误消息如下:500请求超时的Web服务器无法响应天蓝色.
The exact error message is the following: 500 the request timed out web server failed to respond azure.
如果有人曾经遇到过该消息并知道如何解决该消息,我将不胜感激.
If somebody ever encountered that message and has a clue how to solve it, I would appreciate any help.
谢谢!
推荐答案
对不在HTTP请求中的Web作业进行任何长时间的处理.
Make any long processing in a web job not inside the HTTP request.
当用户提交请求时,获取excel文件,将其上传到Azure存储帐户,将路径存储在数据库中,然后在队列中发布消息.使Web作业侦听队列并进行所需的处理.
When the user submit the request, get the excel file, upload it to an Azure Storage Account, store the path in the database and post a message in a queue. Make the web job listen for the queue and do the needed processing.
您可以使用SignalR将结果传达回去,Web作业可以将消息发送到SignalR集线器,Web应用程序可以获取此消息并为用户显示.
You can communicate the results back using SignalR, the web job can send a message to a SignalR hub and the web application can get this message and display it for the user.
这篇关于Azure ASP .net WebApp-500错误-请求超时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!