共用方式為


Application Insights 金鑰

適用於: SDK v4

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

  1. 檢測金鑰
  2. 應用程式識別碼
  3. API 金鑰

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

注意

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

檢測金鑰

若要取得檢測金鑰:

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

    Application Insights 清單的入口網站螢幕擷取。

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

  3. 按一下 [概觀]

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

    概觀的入口網站螢幕擷取

    檢測金鑰的入口網站螢幕擷取

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

應用程式識別碼

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

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

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

    應用程式標識碼的入口網站螢幕擷取

API 金鑰

若要取得 API 金鑰:

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

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

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

    應用程式識別碼和 API 金鑰的入口網站螢幕快照

    警告

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

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

其他資訊

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