Prerequisites
- Node (>=10.14)
- Docker
- Bot Framework Emulator (>=4.3.0); you can obtain it from here
- Install modules
npm install
- write
.env
file; you may start using.env.template
for local development
cp .env.template local-development/.env
- (OPTIONAL) write
config.yaml
file; you may useconfig.example.yaml
as reference.
cp config.example.yaml local-development/config.yaml
- Configure the mysql database
cd local-development
docker-compose up -d
docker-compose exec mpm-db bash
# inside container
--> mysql -h 127.0.0.1 -u root -e "create database msteamsbot;"
docker-compose exec mpm-server bash
# inside container
--> npx sequelize-cli db:migrate
- Start the database and server
docker-compose up -d
- Connect to the bot endpoint using Bot Framework Emulator
- Add "172.17.0.1" to the setting "localhost override" in the Emulator
- Bot URL would be
http://localhost:3978/api/v1/messages
- Leave app id and password empty for local development
- Uncheck "Bypass ngrod for local addresses"
- Probably, it requires to press "Restart Conversation - New User ID" in the Live Chat tab.
Bot Emulator connected to local service
- Once everything is running, you can insert into the database some data:
- to add some topics:
bash scripts/populate-topics.sh
- to add some users and subscriptions (it requires the topics created above):
bash scripts/populate-users-and-subscriptions.sh
- to add some topics:
prerequisites
ngrok
or equivalent tunneling solution- M365 developer account or access to a Teams account with the appropriate permissions to install an app.
ngrok
: Your app will be run from a localhost server. You will need to setupngrok
in order to tunnel from the Teams client to localhost.
Runngrok
point to port 3978:
ngrok http -host-header=rewrite 3978
You may test that everything is up requesting server info:
$» curl -s https://{subdomain}.ngrok.io/ | jq
"msteams-private-messages@x.y.z"
- Make sure you've checked the Azure ☁️ section. At settings, change the Messaging endpoint pointing to your
ngrok
subdomain
Messaging endpoint:
https://{subdomain}.ngrok.io/api/v1/messages