針對 Azure 雲端服務啟用 Profiler

您可以藉由啟用 Application Insights Profiler 來接收Azure 實例的效能追蹤雲端服務。 分析工具會透過Azure 診斷 擴充功能安裝在 Azure 雲端服務 實例上。

在本指南中,您將了解如何:

  • 啟用 Azure 雲端服務實例,以將診斷資料傳送至 Application Insights。
  • 在您的解決方案中設定 Azure 診斷擴充功能,以安裝分析工具。
  • 部署您的服務並產生流量,以檢視分析工具追蹤。

必要條件

使用 Application Insights 來追蹤要求

當您將 Azure 雲端服務 實例發佈至Azure 入口網站時,請將Application Insights SDK 新增至 Azure 雲端服務

顯示將資訊傳送至 Application Insights 之核取方塊的螢幕擷取畫面。

將 SDK 新增併發布 Azure 雲端服務實例至Azure 入口網站之後,請使用 Application Insights 來追蹤要求:

設定 Azure 診斷擴充功能

找出應用程式角色的 Azure 診斷diagnostics.wadcfgx檔案。

顯示 Azure 雲端服務方案總管中診斷檔案的螢幕擷取畫面。

新增下列 SinksConfig 區段作為 WadCfg 的子元素:

<WadCfg>
  <DiagnosticMonitorConfiguration>...</DiagnosticMonitorConfiguration>
  <SinksConfig>
    <Sink name="MyApplicationInsightsProfiler">
      <!-- Replace with your own Application Insights instrumentation key. -->
      <ApplicationInsightsProfiler>00000000-0000-0000-0000-000000000000</ApplicationInsightsProfiler>
    </Sink>
  </SinksConfig>
</WadCfg>

注意

應用程式和 ApplicationInsightsProfiler 接收所使用的檢測金鑰必須相符。

使用新的診斷設定部署您的服務。 Application Insights Profiler 現在已設定為在 Azure 雲端服務 實例上執行。

下一步

注意

針對檢測金鑰擷取的支援將在 2025 年 3 月 31 日結束。 檢測金鑰擷取將會繼續運作,但我們將不再提供該功能的更新或支援。 轉換至連接字串以利用新功能