Azure App Service 診斷概觀Azure App Service diagnostics overview

當您執行 Web 應用程式時,必須為使用者因 500 錯誤向您反映網站已關閉的所有可能問題作好準備。When you’re running a web application, you want to be prepared for any issues that may arise, from 500 errors to your users telling you that your site is down. App Service 診斷是一種智慧型且互動式的體驗,可協助您針對應用程式進行疑難排解,而不需要設定。App Service diagnostics is an intelligent and interactive experience to help you troubleshoot your app with no configuration required. 當您的應用程式發生問題時,App Service 診斷會指出錯誤的原因,以引導您更輕鬆且快速地針對問題進行疑難排解並加以解決。When you do run into issues with your app, App Service diagnostics points out what’s wrong to guide you to the right information to more easily and quickly troubleshoot and resolve the issue.

雖然當您的應用程式在過去24小時內遇到問題時,這項體驗非常有説明,但所有的診斷圖表一律可供您分析。Although this experience is most helpful when you’re having issues with your app within the last 24 hours, all the diagnostic graphs are always available for you to analyze.

App Service 診斷不僅適用於 Windows 上您的應用程式,也適用於 Linux/容器App Service EnvironmentAzure Functions 上的應用程式。App Service diagnostics works for not only your app on Windows, but also apps on Linux/containers, App Service Environment, and Azure Functions.

開啟 App Service 診斷Open App Service diagnostics

若要存取 App Service 診斷,請流覽至您的 App Service web 應用程式或 Azure 入口網站中的 App Service 環境。To access App Service diagnostics, navigate to your App Service web app or App Service Environment in the Azure portal. 在左方導覽列中,按一下 [診斷並解決問題]。In the left navigation, click on Diagnose and solve problems.

針對 Azure Functions,請流覽至您的函數應用程式,然後在頂端導覽中,按一下 [平臺功能],然後從 [資源管理] 區段選取 [診斷並解決問題]。For Azure Functions, navigate to your function app, and in the top navigation, click on Platform features, and select Diagnose and solve problems from the Resource management section.

在 App Service 診斷首頁中,您可以使用每個首頁磚中的關鍵字,選擇最能描述應用程式問題的類別。In the App Service diagnostics homepage, you can choose the category that best describes the issue with your app by using the keywords in each homepage tile. 此外,您可以在此頁面找到 Windows 應用程式的 診斷工具Also, this page is where you can find Diagnostic Tools for Windows apps. 請參閱 (僅適用于 Windows 應用程式) 的診斷工具 See Diagnostic tools (only for Windows app).

首頁

注意

如果您的應用程式已關閉或執行速度很慢,您可以 收集分析追蹤 ,以找出問題的根本原因。If your app is down or performing slow, you can collect a profiling trace to identify the root cause of the issue. 分析是輕量,且是針對生產案例而設計。Profiling is light weight and is designed for production scenarios.

互動式介面Interactive interface

一旦您選取最符合應用程式問題的首頁類別,App Service 診斷的互動式介面瓶精靈可引導您完成診斷和解決應用程式的問題。Once you select a homepage category that best aligns with your app's problem, App Service diagnostics' interactive interface, Genie, can guide you through diagnosing and solving problem with your app. 您可以使用瓶精靈提供的磚快速鍵來查看您感興趣之問題類別的完整診斷報告。You can use the tile shortcuts provided by Genie to view the full diagnostic report of the problem category that you are interested. 圖格快速鍵可讓您直接存取診斷計量。The tile shortcuts provide you a direct way of accessing your diagnostic metrics.

圖格快速鍵

按一下這些圖格之後,您就可以看到與圖格中所述問題相關的主題清單。After clicking on these tiles, you can see a list of topics related to the issue described in the tile. 這些主題會提供完整報告中值得注意的資訊片段。These topics provide snippets of notable information from the full report. 您可以按一下任何這些主題,進一步調查問題。You can click on any of these topics to investigate the issues further. 此外,您也可以按一下 [ View Full Report ] 來探索單一頁面上的所有主題。Also, you can click on View Full Report to explore all the topics on a single page.

主題

View Full Report

診斷報告Diagnostic report

當您按一下某個主題來進一步調查問題之後,就可以查看有關此主題的更多詳細資料,通常會使用圖形和 markdown 來補充。After you choose to investigate the issue further by clicking on a topic, you can view more details about the topic often supplemented with graphs and markdowns. 診斷報告可以是用來查明應用程式問題的強大工具。Diagnostic report can be a powerful tool for pinpointing the problem with your app.

診斷報告

健康狀態檢查Health checkup

如果您不知道您的應用程式有什麼問題,或是不知道要從何處著手針對您的問題進行疑難排解,則健全狀況檢查是不錯的開端。If you don't know what’s wrong with your app or don’t know where to start troubleshooting your issues, the health checkup is a good place to start. 健全狀況檢查會分析您的應用程式,為您提供快速且互動式的總覽,指出狀況良好、有什麼問題,並告訴您要在何處調查問題。The health checkup analyzes your applications to give you a quick, interactive overview that points out what’s healthy and what’s wrong, telling you where to look to investigate the issue. 其智慧型及互動式的介面可提供您進行疑難排解程序的指導方針。Its intelligent and interactive interface provides you with guidance through the troubleshooting process. 健全狀況檢查已與適用于 Linux 應用程式的 Windows 應用程式和 web 應用程式的瓶精靈體驗進行整合,並已關閉診斷報告。Health checkup is integrated with the Genie experience for Windows apps and web app down diagnostic report for Linux apps.

健全狀況檢查圖表Health checkup graphs

健全狀況檢查中有四個不同的圖形。There are four different graphs in the health checkup.

  • 要求和錯誤: 顯示過去24小時內所提出的要求數目以及 HTTP 伺服器錯誤的圖形。requests and errors: A graph that shows the number of requests made over the last 24 hours along with HTTP server errors.
  • 應用程式效能: 顯示過去24小時內各種百分位數群組回應時間的圖形。app performance: A graph that shows response time over the last 24 hours for various percentile groups.
  • CPU 使用量: 此圖表顯示過去24小時內每個實例的整體 CPU 使用率百分比。CPU usage: A graph that shows the overall percent CPU usage per instance over the last 24 hours.
  • 記憶體使用量: 此圖表顯示過去24小時內每個實例的整體實體記憶體使用量百分比。memory usage: A graph that shows the overall percent physical memory usage per instance over the last 24 hours.

健康狀態檢查

只針對 Windows 應用程式) 調查應用程式程式碼問題 (Investigate application code issues (only for Windows app)

因為許多應用程式問題與您應用程式程式碼中的問題相關,App Service 診斷與 Application Insights 整合,以反白顯示要與所選停機狀況相互關聯的例外狀況和相依性問題。Because many app issues are related to issues in your application code, App Service diagnostics integrates with Application Insights to highlight exceptions and dependency issues to correlate with the selected downtime. Application Insights 必須分開啟用。Application Insights has to be enabled separately.

Application Insights

若要查看 Application Insights 的例外狀況和相依性,請選取 [ web 應用程式關閉 ] 或 [ web 應用程式緩慢 ] 磚快速鍵To view Application Insights exceptions and dependencies, select the web app down or web app slow tile shortcuts.

(僅適用于 Windows 應用程式) 的疑難排解步驟Troubleshooting steps (only for Windows app)

如果在過去24小時內偵測到有特定問題類別的問題,您可以查看完整的診斷報告,App Service 診斷可能會提示您查看更多的疑難排解建議和後續步驟,以提供更多引導式體驗。If an issue is detected with a specific problem category within the last 24 hours, you can view the full diagnostic report, and App Service diagnostics may prompt you to view more troubleshooting advice and next steps for a more guided experience.

Application Insights 和疑難排解和後續步驟

診斷工具 (僅適用于 Windows 應用程式) Diagnostic tools (only for Windows app)

診斷工具組含更先進的診斷工具,可協助您調查應用程式程式碼問題、緩慢、連接字串等等。Diagnostics Tools include more advanced diagnostic tools that help you investigate application code issues, slowness, connection strings, and more. 和主動式工具可協助您降低 CPU 使用量、要求和記憶體的問題。and proactive tools that help you mitigate issues with CPU usage, requests, and memory.

主動式 CPU 監視Proactive CPU monitoring

主動式 CPU 監視可讓您在應用程式的應用程式或子進程耗用大量的 CPU 資源時,以簡單主動的方式採取動作。Proactive CPU monitoring provides you an easy, proactive way to take an action when your app or child process for your app is consuming high CPU resources. 您可以設定自己的 CPU 閾值規則,以暫時降低高 CPU 問題,直到找到未預期問題的真正原因為止。You can set your own CPU threshold rules to temporarily mitigate a high CPU issue until the real cause for the unexpected issue is found. 如需詳細資訊,請參閱在 CPU 問題發生前加以緩和For more information, see Mitigate your CPU problems before they happen.

主動式 CPU 監視

自動修復和主動式自動修復Auto-healing and proactive auto-healing

當您的應用程式發生非預期的行為時,自動修復是您可以採取的緩和措施。Auto-healing is a mitigation action you can take when your app is having unexpected behavior. 您可以根據要求計數、慢速要求、記憶體限制和 HTTP 狀態碼來設定您自己的規則,以觸發緩和措施。You can set your own rules based on request count, slow request, memory limit, and HTTP status code to trigger mitigation actions. 在您找出根本原因之前,請使用此工具暫時緩和非預期的行為。Use the tool to temporarily mitigate an unexpected behavior until you find the root cause. 如需詳細資訊,請參閱 宣佈 app service 診斷中的新自動修復體驗For more information, see Announcing the new auto healing experience in app service diagnostics.

自動修復

主動自動修復就像主動式 CPU 監視一樣,是減少應用程式非預期行為的轉換關鍵解決方案。Like proactive CPU monitoring, proactive auto-healing is a turn-key solution to mitigating unexpected behavior of your app. 當 App Service 判斷您的應用程式處於無法復原的狀態時,主動式自動修復會重新開機您的應用程式。Proactive auto-healing restarts your app when App Service determines that your app is in an unrecoverable state. 如需詳細資訊,請參閱 主動式自動修復簡介For more information, see Introducing Proactive Auto Heal.

在持續整合的大型小組中,以及您的應用程式有許多相依性的情況下,可能很難找出造成狀況不良行為的特定變更。In a large team with continuous integration and where your app has many dependencies, it can be difficult to pinpoint the specific change that causes an unhealthy behavior. 導覽器會自動呈現您應用程式的相依性對應,以及相同訂用帳戶中的所有資源,以協助您瞭解應用程式的拓撲。Navigator helps get visibility on your app’s topology by automatically rendering a dependency map of your app and all the resources in the same subscription. [導覽器] 可讓您查看應用程式及其相依性所做之變更的匯總清單,並縮小造成狀況不良行為的變更。Navigator lets you view a consolidated list of changes made by your app and its dependencies and narrow down on a change causing unhealthy behavior. 您可以透過首頁磚導覽來存取它,並在第一次使用 之前,必須 先啟用。It can be accessed through the homepage tile Navigator and needs to be enabled before you use it the first time. 如需詳細資訊,請參閱 使用導覽器瞭解應用程式的相依性For more information, see Get visibility into your app's dependencies with Navigator.

導覽器預設頁面

差異視圖

應用程式變更的變更分析可透過磚快速鍵來存取、 應用程式變更應用程式可用性和效能 上損毀,讓您可以同時與其他計量一起使用。Change analysis for app changes can be accessed through tile shortcuts, Application Changes and Application Crashes in Availability and Performance so you can use it concurrently with other metrics. 在使用此功能之前,您必須先啟用它。Before using the feature, you must first enable it. 如需詳細資訊,請參閱 宣佈 App Service 診斷中的新變更分析體驗For more information, see Announcing the new change analysis experience in App Service Diagnostics.

在標題中新增 "[診斷]",以在 UserVoice 張貼您的問題或意見反應。Post your questions or feedback at UserVoice by adding "[Diag]" in the title.