對技能或技能消費者進行偵錯Debug a skill or skill consumer

適用于: SDK v4APPLIES TO: SDK v4

您可能需要將技能或技能取用者 bot (您想要在本機執行的偵錯工具)執行于本機,而另一個則是在雲端中執行。You may need to debug a skill or skill consumer bot, where the one you want to debug is running locally and the other is running in the cloud. 在這種情況下,您可以使用 ngrok 工具,以公用 URL 公開本機 bot 端點。In this situation, you can use the ngrok tool to expose the local bot endpoint as a public URL.

必要條件Prerequisites

若要將本機技能取用者To debug a local skill consumer

在此案例中,您不需要修改已部署技能的設定,而且可以使用 Bot Framework Emulator 來直接測試取用者。In this scenario, you do not need to modify the configuration of the deployed skill and you can use the Bot Framework Emulator to test the consumer directly.

  1. 設定本機 bot 的通道端點,並在 Azure 入口網站中設定其註冊,如如何 使用 ngrok 從任何通道中的 bot 進行調試程式中所述。Set up a tunnelling endpoint for the local bot and configure its registration in the Azure portal as described in how to debug a bot from any channel using ngrok.
  2. 更新取用者的應用程式設定,並將技能主機端點設定為 ngrok 所產生的 URL。Update the consumer's application configuration, and set the skill host endpoint to the URL generated by ngrok.
  3. 最後,在本機執行取用者並連接至,如如何 使用模擬器進行偵錯工具中所述。Finally, run the consumer locally and connect to it as described in how to debug with the Emulator.

提示

本機取用者將需要有效的應用程式識別碼和密碼。The local consumer will need a valid app ID and password.

若要將本機技能 botTo debug a local skill bot

當您測試技能的變更時,您可能會想要在從預備伺服器上裝載的取用者 bot 存取時,在本機執行和錯用。While you are testing changes to a skill, you may want to run and debug it locally while it is accessed from a consumer bot hosted on a staging server.

在此案例中,您必須修改已部署之技能取用者的設定。In this scenario, you need to modify the configuration of the deployed skill consumer. 因為您將使用取用者來測試 bot。Since you will use the consumer to test the bot.

  1. 設定本機 bot 的通道端點,並在 Azure 入口網站中設定其註冊,如如何 使用 ngrok 從任何通道中的 bot 進行調試程式中所述。Set up a tunnelling endpoint for the local bot and configure its registration in the Azure portal as described in how to debug a bot from any channel using ngrok.
  2. 更新取用者的應用程式設定,並將技能端點設定為 ngrok 所產生的 URL。Update the consumer's application configuration, and set the skill endpoint to the URL generated by ngrok. 您可以直接在伺服器上編輯設定,或者您可能必須重新部署技能取用者。You may be able to edit the configuration directly on the server or you may have to redeploy the skill consumer.
  3. 在本機執行技能,並從技能取用者加以叫用。Run the skill locally and invoke it from the skill consumer.

提示

本機技能將需要有效的應用程式識別碼和密碼。The local skill will need a valid app ID and password.