Function-as-a-service to send a one-to-one message between a technical account and an employee. You can use it as a notification channel between any application and employees.
Assuming that you already have the OpenFaaS (alternatively faasd), the steps are:
Please follow the instruction. Please focus on Register an application only.
After creating, go to Authentication > Advanced settings > Allow public client flows > Enable the following mobile and desktop flows:, select Yes.
You have to create a couple of secrets.
Secret name | Description |
---|---|
ms-teams-message-az-client-id |
Azure Active Directory Application Client Id |
ms-teams-message-upn |
Your technical account User Principal Name |
ms-teams-message-password |
Your technical account password |
ms-teams-message-sentry-dsn |
Sentry DSN. If you don't want to use it, just type anything. |
faas-cli secret create ms-teams-message-az-client-id --gateway <OpenFaaS Gateway>
faas-cli secret create ms-teams-message-upn --gateway <OpenFaaS Gateway>
faas-cli secret create ms-teams-message-password --gateway <OpenFaaS Gateway>
faas-cli secret create ms-teams-message-sentry-dsn --gateway <OpenFaaS Gateway>
faas-cli deploy -f ms-teams-message.yml --gateway <OpenFaaS Gateway>
To send a message simply call the POST method on http://<OpenFaaS Gateway>/function/ms-teams-message
with payload:
{
"recipient": "[email protected]",
"message": "The message body can contain HTML tags. For example you can `<b>bold some part of the message body</b>."
}