Skip to main content

Deploying webhooks

In this section, you'll learn how to set up a webhook using the Taskurai CLI.

Prerequisites​

  • A Taskurai installation (Taskurai instance, Taskurai CLI, ...). See Taskurai Setup.

Setup the configuration file​

  1. Navigate to the folder containing the taskurai.yaml configuration file.

  2. Add a sample webhook to the configuration file, sending all completed tasks of a command to a logic apps endpoint, include the full task payload.

taskurai-workers/Taskurai.yaml
...
webhooks:
UploadDailySalesSAP:
description: Catch all completed tasks for the command UploadDailySalesSAP
url: https://webhook.site/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX
events:
- UploadDailySalesSAP.*
includeFullPayload: true
...

Deploy webhook to Taskurai​

Next, deploy the webhook to Taskurai using the CLI:

taskurai webhook deploy

When creating a webhook for the first time and no secret token is provided, a secret token will be generated and displayed once:

This secret token will only be displayed once. Copy the token to a secure place, do not share this token, do not check this token into source control.


Secret token UploadDailySalesSAP:
p+T3kilXNpwqrRmvIpKzwoTKkySo5gtO3483Z1ELunk=

# Succesfully deployed webhook resource UploadDailySalesSAP.
info

The number supported webhooks is depending on your Taskurai plan.

Testing your setup​

To verify that the webhook has been successfully deployed to Taskurai, use the following command:

taskurai webhook show --name UploadDailySalesSAP

When the deployment is successful, you should see output similar to the following:

# Signed into Taskurai

UploadDailySalesSAP
├── General
│ └── ╭──────────────────────┬───────────────────────────────────────────────────────────────╮
│ │ Setting │ Value │
│ ├──────────────────────┼───────────────────────────────────────────────────────────────┤
│ │ Name │ UploadDailySalesSAP │
│ │ Description │ Catch all completed tasks for the command UploadDailySalesSAP │
│ │ Url │ https://webhook.site/XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX │
│ │ Secret │ null │
│ │ Category │ null │
│ │ External Id │ null │
│ │ External Account Id │ null │
│ │ External User Id │ null │
│ │ Unlisted │ null │
│ │ Isolation Mode │ true │
│ │ Isolation Key │ dd10b001-addd-45c2-94a6-932282b7515c │
│ │ Include Full Payload │ true │
│ │ Include Sensitive │ true │
│ ╰──────────────────────┴───────────────────────────────────────────────────────────────╯
├── Events
│ └── ╭───────────────────────╮
│ │ Events │
│ ├───────────────────────┤
│ │ UploadDailySalesSAP.* │
│ ╰───────────────────────╯
└── Tags
└── ╭─────────┬───────╮
│ Setting │ Value │
╰─────────┴───────╯

That's it! You have successfully deployed a webhook to Taskurai.

Default scopes​

Webhooks created by the CLI assume administrator access. Data returned have these scopes by default:

  • Data/Buildby.Taskurai/sensitive/read: Can return sensitive data.
  • Data/Buildby.Taskurai/secrets/read: Can read global secrets.

To override the sensitive behavior, it is possible to turn includeSensitive off in the webhook configuration.

More information​

Read the section Webhook configuration to learn more about the configuration options.