-
Notifications
You must be signed in to change notification settings - Fork 23
[Web service] Microsoft bot hook
Hosted by laitos web server, users may initiate a chat (e.g. Skype) with laitos to invoke app commands
The web hook is compatible with the Microsoft Bot Framework (aka Azure Bot services).
- Sign up for a Microsoft Azure account, navigate to your Resource Group, and create a new Azure Bot. Choose "Multi Tenant" for the Microsoft App ID.You may wish to change the Pricing Tier choice from "Standard" to "Free" for a start.
- Navigate to the "Bot profile" tab of the newly created bot and complete the profile details.
- Navigate to the "Configuration" tab of the newly created bot, craft a new URL
on your laitos server that will serve as the bot's web hook, and write it down
into "Message endpoint" (e.g.
https://laitos.example.com/bot-web-hook
). Note down the URL and "Microsoft App ID" for use later in laitos configuration. - Navigate to the "Channels" tab of the newly created bot and connect the bot to end-user channels as you wish, such as Skype.
Next, navigate to the Azure Key Vault that was automatically created alongside the new bot and retrieve the application ID and :
- Visit the key vault's "Access policies" and add a new policy to grant yourself all permissions in the key vault.
- Navigate to "Secrets" and inspect the current version of the only secret entity.
- Click "Show Secret Value" to reveal the application secret. Note it down for use later in laitos configuration.
- Place the following JSON data under JSON key
HTTPHandlers
:- String
MicrosoftBotEndpoint1
- URL location that will serve Microsoft bot; keep it a secret to yourself, and make it difficult to guess. - Object
MicrosoftBotEndpointConfig1
that comes with the following mandatory properties:
- String
Property | Type | Meaning |
---|---|---|
ClientAppID | string | "Microsoft App ID" displayed in the Configuration tab of the Azure Bot. |
ClientAppSecret | strings | The secret value of the secret entity in the key vault automatically created alongside the new bot.. |
- Follow command processor to construct configuration for
JSON key
HTTPFilters
.
Here is an example:
{ ... "HTTPHandlers": { ... "MicrosoftBotEndpoint1": "/very-secret-microsoft-bot-hook", "MicrosoftBotEndpointConfig1": { "ClientAppID": "abcde-fghijkl-mnopqrs-xyz012", "ClientAppSecret": "b54xni73chmixdd9as3288" }, ... }, ... }
The service is hosted by web server, therefore remember to run the web server.
As required by Azure bot service, the web server must have a valid TLS certificate and present its complete certificate chain to HTTPS clients.
Visit Azure Bot services,
click on the bot name, and visit the Channels
tab. Click Add to Skype
to
add the bot as a Skype contact.
Initiate a chat with the Skype contact, enter password followed by app command, and the command result will arrive in a chat reply.
- Make the endpoint URLs to guess, this helps to prevent misuse of the service.
- A laitos server may serve up to three bots. To configure more than one bot,
fill in the configuration for
MicrosoftBotEndpoint2
,MicrosoftBotEndpoint3
, as well asMicrosoftBotEndpointConfig2
andMicrosoftBotEndpointConfig3
.
Table of Contents
- Home
- Get started
- Component list
- Tips for running on public cloud
- Tips for using apps over satellite
- laitos terminal
Daemon Components
- DNS server
- Mail server
- Web server
- Web proxy server
- Telnet server
- Telegram chat-bot
- Simple IP services server
- SNMP server
- System maintenance
- Phone home telemetry
Web Service Components
- Twilio telephone/SMS hook
- Microsoft chat bot hook
- The Things Network LORA tracker integration
- Recurring commands
- App command form
- Simple app command execution API
- GitLab browser
- Temporary file storage
- Simple web proxy
- Desktop on a page (virtual machine)
- Read telemetry records
- Program health report
- System process explorer
- Prometheus metrics exporter
- HTTP request inspector
- HTTP request logger
Apps