LoginSignup
0
0

More than 5 years have passed since last update.

Azure Functions BotのソースZIPファイルをローカルデバッグする方法

Posted at

QnAmakerとつないだAzureFunctionsBotからダウンロードしたZIPファイルソースをPCローカルでデバッグする方法です。

環境

  • Visual Studio 2017
  • Windows10 (ビルド1703)

手順

Azure Functions CLIインストール

この手順で実施

DotNet CLIインストール

Get started with .NET in 10 minutesの項番1だけ実施で大丈夫っぽいです。
image.png
以下の画面で[install]
image.png
この画面で[Close]
image.png
WindowsPowerShellでdotnetコマンド打って以下の応答があればOK
image.png

BotFramework Emulator

BotFramework-Emulatorからダウンロードします。

Azure Functions BotからソースZIPファイルをダウンロード

ポータル>ビルド>zip ファイルをダウンロードからダウンロードできます。
image.png

ローカルでデバッグ

Visual Studio 2017を管理者として実行して起動します。
image.png

ファイル > 開く > プロジェクト/ソリューション からダウンロードした ソリューション ファイル “Bot.sln” を開きます。
image.png

コマンドプロンプトかWindowsPowerShellを管理者として起動し、Bot.slnの展開先へ移動します

以下のコマンドでbotをローカルで起動します

powershell
> .\debughost.cmd

image.png

ずらずらと水色の文字が流れまして最後にこんなのが出力されるはずです。
image.png

このhttpから始まるのがエンドポイントです。

Emulatorで起動

Bot Framework Emulatorを起動してエンドポイントを入力します。Microsoft App IDやMicrosoft App Passwordは空欄でOK
image.png

動いた~~
image.png

終わる時にはPowerShellでCtrl+Cすればよいかと。
ちなみにAzureFunctionsのアプリ設定の項目にIDやKeyを入れていた場合はZIPソースには入らないのでローカルでは動作しません。ご注意ください。

参考ドキュメント

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0