簡體   English   中英

Azure 函數在日志中顯示成功但在門戶測試中返回 503 錯誤以及在 Postman 中返回 502 錯誤

[英]Azure Functions showing successful in logs but returning 503 error in portal test as well as 502 error in Postman

我的 Azure 功能(消費計划)中的某些功能運行良好,但同一應用程序中的其他功能運行不正常。 他們在日志中顯示成功,但在瀏覽器/客戶端應用程序/postman 中顯示 502 錯誤

值得注意的是,這些功能需要做的一切(更新 cosmos 數據庫,發送 email )都在工作,甚至日志顯示成功但門戶測試中存在以下錯誤


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.

可能是什么問題? 另外,我注意到運行良好的函數沒有任何與發送電子郵件相關的代碼,而那些不起作用的函數有發送 email 的代碼(並且電子郵件發送正確)

請檢查以下步驟是否有助於解決問題:

Azure 門戶錯誤是HTTP 響應代碼 503 服務不可用

這種情況的發生是由於網絡連接或服務可用性問題。

更好的方法是重試該操作,如果問題仍然存在,請聯系此處引用的 Azure 支持。

解決此錯誤的替代方法是通過導航到“ Diagnose and solve problems to know the root cause of因為此錯誤可能有多種原因。

在此處輸入圖像描述

如果有助於解決問題,請檢查以下與503 error問題相關的原因:

  • 請求需要很長時間
  • 應用程序因異常而崩潰。
  • 平均響應時間長
  • Function 應用也是一個應用服務,所以應用服務強制限制出站連接數

瀏覽器錯誤 / Postman 是502 - Web 服務器在充當網關或代理服務器時收到無效響應。

由於此502 error ,您已在MSFT Q&A中得到解決。

通常,在連接中放置HTTP而不是HTTPS時會發生502 error ,但我知道 Azure 函數端點看起來像這種格式

http://<APP_NAME>.azurewebsites.net/api/<FUNCTION_NAME>

當最大超時超過該值時會發生502 error

  • 請檢查function應用程序的超時值和Application Insights中的日志、requestTime、responseTime的指標,如果是原因,請增加超時值。

參考:

  1. 502 錯誤的故障排除原因
  2. 如何修復我的 Azure Function 上的這個 502 錯誤?

找到解決方案返回 100-199 系列中的任何狀態代碼是導致此錯誤的原因。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM