Teamsの認証ボットをngrokで実行したいが、エラーが発生する

実現したいこと

https://github.com/OfficeDev/Microsoft-Teams-Samplesにあるbot-teams-authentication
をngrok経由でローカル環境で実行したいと考えています

発生している問題・分からないこと

Bot Framework Emulatorでエラーが発生します

エラーメッセージ

error

1[10:29:46]Connecting to bot on https://b9a0-1-21-119-101.ngrok-free.app/api/messages 2[10:29:46]Emulator listening on http://[::]:58122 3[10:29:46]Failed to spawn ngrok. Please go to the Ngrok Status Viewer and download the log file for a more detailed view of the error.{"error_code":102,"status_code":400,"msg":"invalid tunnel configuration","details":{"err":"yaml: unmarshal errors:\n line 1: field region not found in type config.HTTPv2Tunnel\n line 1: field path not found in type config.HTTPv2Tunnel"}} 4[10:29:46]-> conversationUpdate 5[10:29:46]Error: The bot is remote, but the service URL is localhost. Without tunneling software you will not receive replies. 6[10:29:46]Connecting to bots hosted remotely 7[10:29:46]Configure ngrok 8[10:29:46]Cannot post activity. Unauthorized.

該当のソースコード

特になし

試したこと・調べたこと

上記の詳細・結果
  1. リポジトリをクローン

git clone https://github.com/OfficeDev/Microsoft-Teams-Samples.git
2. samples\bot-teams-authentication\nodejsフォルダに移動。
3. npm installを実行
4. .envファイルの下記の値を、自分の環境の値に修正
MicrosoftAppType
MicrosoftAppId
MicrosoftAppPassword
MicrosoftAppTenantId
connectionName
5. ngrok http 3978 --log=ngrok.log --host-header="localhost:3978"を実行
6. Forwarding http://abcd1234.ngrok.io -> http://localhost:3978
のhttp://abcd1234.ngrok.ioをコピー
7.Bot Framework Emulatorの
BotURLにhttp://abcd1234.ngrok.io/api/messages
AppIDにMicrosoftAppTenantId
を設定しBrowseをクリック

補足

ngrok.logは下記のようになっており、問題はないように見えます。

t=2024-05-24T10:33:09+0900 lvl=info msg="no configuration paths supplied"
t=2024-05-24T10:33:09+0900 lvl=warn msg="ngrok config file found at both XDG and legacy locations, using XDG location" xdg_path=C:\Users\cre0612\AppData\Local/ngrok/ngrok.yml legacy_path=C:\Users\cre0612\.ngrok2\ngrok.yml
t=2024-05-24T10:33:09+0900 lvl=info msg="using configuration at default config path" path=C:\Users\UsersName\AppData\Local/ngrok/ngrok.yml
t=2024-05-24T10:33:09+0900 lvl=info msg="open config file" path=C:\Users\UsersName\AppData\Local\ngrok\ngrok.yml err=nil
t=2024-05-24T10:33:09+0900 lvl=info msg="starting web service" obj=web addr=127.0.0.1:4040 allow_hosts=[]
t=2024-05-24T10:33:09+0900 lvl=info msg="client session established" obj=tunnels.session
t=2024-05-24T10:33:09+0900 lvl=info msg="tunnel session started" obj=tunnels.session
t=2024-05-24T10:33:09+0900 lvl=info msg="started tunnel" obj=tunnels name=command_line addr=http://localhost:3978 url=https://a505-1-21-119-101.ngrok-free.app
t=2024-05-24T10:33:09+0900 lvl=info msg="update available" obj=update

ngrok.ymlファイルにregion: apを記載したのですが、同じエラーになります。

コメントを投稿

0 コメント