Following steps are involved in setting up Teams Messaging Extension application locally and securely tunnel it:
- Get AppID and AppPassword of the Bot application from Azure AD.
- Get Ticket Collaboration messaging extension.
- Update Environment Variables.
- Run Node.js bot application.
- Establish a secure HTTP tunnel using Ngrok.
- Update Messaging Endpoint.
-
Go to Azure Portal.
-
Navigate to Azure AD and select "App Registrations" from the side menu.
-
Open the the Azure AD application which was created along with the creation of Multi Tenant Bot resource (Ex:
ExportChatBot).
-
Note down the
Application (client) IDfrom the "Overview" section.
-
Create a new "Client Secret" by clicking on "New client secret" in the "Certificates & secrets" section of the app. Set the validity to maximum available value and click on "Save". Note down the "Value" of newly created client secret.

Get the Ticket Collaboration Node.js application from GitHub.
- You can clone the repository into your computer or download the repository as a zip file.
-
Open the cloned/downloaded Ticket Collaboration messaging extension's code-base using VS Code.
-
Navigate to
/backendfolder and open.envfile.- 2.1. Update
MicrosoftAppIdwith the AppID of the bot registration, obtained in the previous section. - 2.2. Update
MicrosoftAppPasswordwith the Client Secret of the bot registration, created in the previous section. - 2.3. Update
connectionNamewith the name of the OAuth Connection settings noted during identity provider registration (step 4).
# MS BOT app credentials MicrosoftAppId=<your-app-id> MicrosoftAppPassword=<your-app-secret> connectionName=<your-connection-name>- 2.4. Set your Cloud for Customer(C4C) tenant information like below.
# SAP Service Cloud (Cloud for Customers, C4C) c4cApiId=<SAP_SERVICE_CLOUD_C4C_API_ID> c4cApiPassword=<SAP_SERVICE_CLOUD_C4C_API_PASSWORD> c4cTenantUrl=<SAP_SERVICE_CLOUD_C4C_TENANT_URL> - 2.1. Update
- Open the embedded terminal in VS Code using
Ctrl + `. - Navigate to
/backendfolder from the root of the repository and install required dependencies usingnpm install. - Start the application using
npm start.
- Note: Server will start at the port 8080 by default if the port is free.
-
Create an ngrok account and add its auth token to your local environment. The token can be found in the ngrok dashboard.
ngrok authtoken <token> -
Establish a secure HTTP tunnel for the locally running bot application using
ngrok http -host-header=rewrite 8080in a new VS Code terminal.#Ngrok command ngrok http -host-header=rewrite <port-number>Important: Tunnel should be established at the same port where the Node.js bot application is listening to.
-
Copy HTTPS endpoint created for the application.
Important: Messaging endpoint should be updated each time when you restart Ngrok. This is due to the change in domain name when you restart Ngrok tunneling (free version).
-
Go to Azure Portal and click on "Resource Groups". Navigate to the resource group created for the Messaging Extension Bot.

-
Navigate to "Configurations" page set messaging endpoint to
https://{{ngrok-domain}}/api/messages.
Ex:https://xxxx-xxxx-xxxx-xxxx-xxx-xxxx.ngrok.io/api/messages.
-
Click on "Apply" at the bottom of the page.
Note: After deploying the application in the SAP Business Technology Platform, there is no need for Ngrok tunneling. Update the messaging endpoint with the BTP URL.
