Azure Functions 在日志中显示成功,但在门户测试中返回 503 错误,在 Postman 中返回 502 错误
Azure Functions showing successful in logs but returning 503 error in portal test as well as 502 error in Postman
我的 Azure Functions(消费计划)中的某些功能 运行 正常,但同一应用程序中的其他功能 运行 不正确。他们在日志中显示成功,但在浏览器/客户端应用程序/邮递员中显示 502 错误
值得注意的是,这些功能需要做的一切(更新 cosmos 数据库、发送电子邮件)都在工作,甚至日志显示成功,但门户测试中存在以下错误
Azure 门户中的错误是
HTTP 响应代码 503 服务不可用
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html
xmlns='http://www.w3.org/1999/xhtml'><head><meta content='text/html;
charset=utf-8' http-equiv='content-type'/><style type='text/css'>
body {font-family:Arial; margin-left:40px; }img { border:0 none; }
#content { margin-left: auto; margin-right: auto }#message h2
{ font-size: 20px; font-weight: normal; color: #000000; margin: 34px 0px 0px 0px }
#message p { font-size: 13px; color: #000000; margin: 7px 0px 0px0px}
#errorref { font-size: 11px; color: #737373; margin-top: 41px }</style>
<title>Service unavailable</title></head><body><div id='content'><div id='message'>
<h2>Our services aren't available right now</h2><p>We're working to restore all
services as soon as possible. Please check back soon.</p></div><div id='errorref'>
浏览器/Postman 中的错误是
502 - Web 服务器在充当网关或代理服务器时收到无效响应。
There is a problem with the page you are looking for,
and it cannot be displayed. When the Web server
(while acting as a gateway or proxy) contacted the upstream content
server, it received an invalid response from the content server.
可能是什么问题?
另外,我注意到 运行 的函数没有任何与发送电子邮件相关的代码,而那些不起作用的函数有发送电子邮件的代码(并且电子邮件被正确发送)
请检查以下步骤是否有助于解决问题:
Error in Azure portal is HTTP response code 503 Service Unavailable
出现这种情况是由于网络连接或服务可用性问题。
更好的方法是重试该操作,如果问题仍然存在,请联系 Azure 支持,如 here。
解决此错误的替代方法是导航至 Diagnose and solve problems to know the root cause of
503 错误` 查找原因,因为此错误可能有多种原因。
请检查以下与 503 error
问题相关的原因是否有助于解决问题:
- 请求耗时较长
- 应用程序因异常而崩溃。
- 平均响应时间长
- Function App 也是一种应用服务,因此应用服务会强制限制出站连接数
Error in Browser / Postman is 502 - Web server received an invalid response while acting as a gateway or proxy server.
由于这个 502 error
,您在 MSFT Q&A 中得到了称呼。
通常,502 error
发生在连接中放置 HTTP
而不是 HTTPS
时,但我知道 Azure Functions 端点看起来像这种格式
http://<APP_NAME>.azurewebsites.net/api/<FUNCTION_NAME>
并且当最大超时超过该值时发生502 error
。
- 请检查函数应用程序的超时值以及Application Insights中requestTime、responseTime的日志、指标,如果是原因,请增加超时值。
参考文献:
找到解决方案返回 100-199 系列中的任何状态代码是导致此错误的原因。
我的 Azure Functions(消费计划)中的某些功能 运行 正常,但同一应用程序中的其他功能 运行 不正确。他们在日志中显示成功,但在浏览器/客户端应用程序/邮递员中显示 502 错误
值得注意的是,这些功能需要做的一切(更新 cosmos 数据库、发送电子邮件)都在工作,甚至日志显示成功,但门户测试中存在以下错误
Azure 门户中的错误是 HTTP 响应代码 503 服务不可用
<!DOCTYPE html PUBLIC '-//W3C//DTD XHTML 1.0 Transitional//EN'
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'><html
xmlns='http://www.w3.org/1999/xhtml'><head><meta content='text/html;
charset=utf-8' http-equiv='content-type'/><style type='text/css'>
body {font-family:Arial; margin-left:40px; }img { border:0 none; }
#content { margin-left: auto; margin-right: auto }#message h2
{ font-size: 20px; font-weight: normal; color: #000000; margin: 34px 0px 0px 0px }
#message p { font-size: 13px; color: #000000; margin: 7px 0px 0px0px}
#errorref { font-size: 11px; color: #737373; margin-top: 41px }</style>
<title>Service unavailable</title></head><body><div id='content'><div id='message'>
<h2>Our services aren't available right now</h2><p>We're working to restore all
services as soon as possible. Please check back soon.</p></div><div id='errorref'>
浏览器/Postman 中的错误是 502 - Web 服务器在充当网关或代理服务器时收到无效响应。
There is a problem with the page you are looking for,
and it cannot be displayed. When the Web server
(while acting as a gateway or proxy) contacted the upstream content
server, it received an invalid response from the content server.
可能是什么问题? 另外,我注意到 运行 的函数没有任何与发送电子邮件相关的代码,而那些不起作用的函数有发送电子邮件的代码(并且电子邮件被正确发送)
请检查以下步骤是否有助于解决问题:
Error in Azure portal is HTTP response code 503 Service Unavailable
出现这种情况是由于网络连接或服务可用性问题。
更好的方法是重试该操作,如果问题仍然存在,请联系 Azure 支持,如 here。
解决此错误的替代方法是导航至 Diagnose and solve problems to know the root cause of
503 错误` 查找原因,因为此错误可能有多种原因。
请检查以下与 503 error
问题相关的原因是否有助于解决问题:
- 请求耗时较长
- 应用程序因异常而崩溃。
- 平均响应时间长
- Function App 也是一种应用服务,因此应用服务会强制限制出站连接数
Error in Browser / Postman is 502 - Web server received an invalid response while acting as a gateway or proxy server.
由于这个 502 error
,您在 MSFT Q&A 中得到了称呼。
通常,502 error
发生在连接中放置 HTTP
而不是 HTTPS
时,但我知道 Azure Functions 端点看起来像这种格式
http://<APP_NAME>.azurewebsites.net/api/<FUNCTION_NAME>
并且当最大超时超过该值时发生502 error
。
- 请检查函数应用程序的超时值以及Application Insights中requestTime、responseTime的日志、指标,如果是原因,请增加超时值。
参考文献:
找到解决方案返回 100-199 系列中的任何状态代码是导致此错误的原因。