Application Insights 金鑰

適用于: SDK v4

Azure Application Insights 會在 Microsoft Azure 資源中顯示應用程式的相關資料。 若要將遙測新增至 Bot,您需要為 Bot 建立的 Azure 訂用帳戶和 Application Insights 資源。 您可以從此資源取得三個金鑰來設定 Bot:

  1. 檢測金鑰
  2. Application ID
  3. API 金鑰

本主題將示範如何建立這些 Application Insights 金鑰。

注意

在 Bot 建立或註冊程式期間,您可以選擇開啟或關閉 Application Insights 如果您已將它 開啟, 則 Bot 已擁有它所需的所有 Application Insights 金鑰。 不過,如果您已將 關閉,您可以依照本主題中的指示來協助您手動建立這些金鑰。

檢測金鑰

若要取得檢測金鑰:

  1. 從Azure 入口網站 的 [監視] 區段底下,建立新的 Application Insights 資源(或使用現有的資源)。

    Portal screen capture of Application Insights listing.

  2. 從 Application Insights 資源清單中,按一下您建立的 Application Insight 資源。

  3. 按一下 [概觀]

  4. 展開 [ 基本資訊] 區塊並尋找 檢測金鑰

    Portal screen capture of Overview

    Portal screen capture of the Instrumentation key

  5. 複製檢測金鑰 ,並將其貼到 Bot 設定的 Application Insights 檢測金鑰 欄位。

Application ID

若要取得應用程式識別碼:

  1. 從 Application Insights 資源中,按一下 [ API 存取 ]。

  2. 複製 [ 應用程式識別碼 ],並將其貼到 Bot 設定的 [Application Insights 應用程式識別碼 ] 欄位。

    Portal screen capture of the Application ID

API 金鑰

若要取得 API 金鑰:

  1. 從 Application Insights 資源中,按一下 [ API 存取 ]。

  2. 按一下 [ 建立 API 金鑰 ]。

  3. 輸入簡短描述,檢查 [ 讀取遙測 ] 選項,然後按一下 [ 產生金鑰 ] 按鈕。

    Portal screen capture of the Application ID and API Key

    警告

    複製此 API 金鑰 並加以儲存,因為此金鑰永遠不會再次向您顯示。 如果您遺失此金鑰,則必須建立新的金鑰。

  4. 將 API 金鑰複製到 Bot 設定的 Application Insights API 金鑰 欄位。

其他資訊

如需如何將這些欄位連線到 Bot 設定的詳細資訊,請參閱 啟用分析