Skip to content
This repository was archived by the owner on Mar 4, 2025. It is now read-only.

Latest commit

 

History

History
111 lines (75 loc) · 5.03 KB

File metadata and controls

111 lines (75 loc) · 5.03 KB

Setup Ticket Collaboration Bot application and establish a secure HTTP tunnel

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

  1. Go to Azure Portal.

  2. Navigate to Azure AD and select "App Registrations" from the side menu.

  3. Open the the Azure AD application which was created along with the creation of Multi Tenant Bot resource (Ex: ExportChatBot). Get AppID

  4. Note down the Application (client) ID from the "Overview" section. Note AppID

  5. 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. Note Secret

 

Get Ticket Collaboration messaging extension

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.

 

Update Environment Variables

  1. Open the cloned/downloaded Ticket Collaboration messaging extension's code-base using VS Code.

  2. Navigate to /backend folder and open .env file.

    • 2.1. Update MicrosoftAppId with the AppID of the bot registration, obtained in the previous section.
    • 2.2. Update MicrosoftAppPassword with the Client Secret of the bot registration, created in the previous section.
    • 2.3. Update connectionName with 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>
    

 

Run Node.js bot application

  1. Open the embedded terminal in VS Code using Ctrl + ` .
  2. Navigate to /backend folder from the root of the repository and install required dependencies using npm install.
  3. Start the application using npm start. Npm Start
    • Note: Server will start at the port 8080 by default if the port is free.

 

Establish a secure HTTP tunnel using Ngrok

  1. 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>
    
  2. Establish a secure HTTP tunnel for the locally running bot application using ngrok http -host-header=rewrite 8080 in 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.

  3. Copy HTTPS endpoint created for the application. Ngrok Tunnel 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).

 

Update Messaging Endpoint

  1. Go to Azure Portal and click on "Resource Groups". Navigate to the resource group created for the Messaging Extension Bot. Go to Resource Group

  2. Open the Messaging Extension Bot. Open Bot

  3. 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. Set Messaging Endpoint

  4. 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.