Skip to content

Configure webhook alerts

You can enable webhook alerts to send AVD deployment and deletion failure notifications to an HTTP endpoint such as Slack, Microsoft Teams, or a custom internal tool. They can run alongside existing email alerts or replace them, depending on the email-fallback setting.

You need a webhook URL from your target system: a Slack incoming webhook, a Teams webhook via the Workflows app, or any HTTPS endpoint that accepts POST requests.

  1. Open the Secure Apps Console and navigate to Alerts → Configure Alerts. Switch to the Webhook tab.

  2. Toggle Enable webhook alerts on.

  3. Choose the HTTP Method. Slack and Teams webhooks expect POST.

  4. Paste the webhook URL into the URL template field. The URL can contain template variables, which is useful if, for example, your endpoint expects the job dashboard link as a query parameter.

  5. Add any Headers your endpoint requires. At minimum, set Content-Type: application/json. Teams Workflows rejects requests without it. Slack accepts the request either way. Custom endpoints might need an Authorization header.

  6. Fill in the Body template. Click Template variables to see the dynamic variables you can use. Below are examples for Slack and Teams:

    {
    "text": "Exam {{.JobType}} issue: {{.ExamName}}",
    "blocks": [
    {
    "type": "header",
    "text": { "type": "plain_text", "text": "Exam {{.JobType}} issue" }
    },
    {
    "type": "section",
    "text": {
    "type": "mrkdwn",
    "text": "*{{.Environment}}* environment\n{{.ExamName}}\nDeadline: `{{.DeadlineTime}}`{{if .DeploymentDurationOverride}}\n_(reservation time overwritten)_{{end}}"
    }
    },
    {
    "type": "actions",
    "elements": [
    { "type": "button", "text": { "type": "plain_text", "text": "View job" }, "url": "{{.JobLogDashboardUrl}}" },
    { "type": "button", "text": { "type": "plain_text", "text": "View exam" }, "url": "{{.ExamUrl}}" }
    ]
    }
    ]
    }
  7. Set the Success status codes. Any response with a code in this list is treated as a successful delivery. Slack and Teams return 200, so the defaults (200, 201, 202, 204) work out of the box. Adjust this only if your endpoint uses a non-standard success code.

  8. Select an Email fallback mode (see below).

  9. Click Update to save.

Use these placeholders anywhere in the URL or body template. They’re substituted per-alert with data from the deployment or deletion job.

VariableExample valueDescription
{{.JobType}}deploymentJob type, either deployment or deletion.
{{.ExamName}}Biology midterm 2026Name of the exam the alert relates to.
{{.ExamUrl}}https://schoolyear.app/admin/exams/abc123Direct link to the exam in the Schoolyear Dashboard.
{{.JobLogDashboardUrl}}https://schoolyear.app/admin/jobs/xyz789Direct link to the job log (helpful for debugging).
{{.DeadlineTime}}2026-04-22 09:24:28.602 +0000 UTCScheduled job deadline for the exam.
{{.DeploymentDurationOverride}}true / falseWhether the reservation time was overwritten.
{{.Environment}}prodThe environment the alert originated from.

Every webhook configuration page includes a Test webhook section so you can verify the endpoint before saving. No real exam has to fail for you to check the integration.

  1. Fill in the test parameters: Job type, whether Reservation time overwritten applies, and a Deadline date/time. These are injected into your URL and body template alongside the hard-coded test values shown below the inputs.

  2. Click Send. The request fires immediately against the URL you’ve typed into the form. The configuration does not need to be saved first.

  3. Inspect the Request panel to see exactly what was sent (method, URL, headers, rendered body) and the Response panel to see the status code, headers, and body returned by your endpoint.

  4. A green Success badge means the response code matched your configured success list. A red Failure badge means it didn’t. Check the Response panel for the real reason (usually a 4xx with an error message from Slack/Teams about the payload shape).

The Email fallback setting controls what happens to the configured email alerts when a webhook is active.

  • Only send email alerts when the webhook fails: email is sent only if the webhook delivery fails (non-success status code, timeout, or unreachable endpoint). Use this when the webhook channel is your primary alerting method.
  • Send both webhook and email alerts: email is always sent alongside the webhook, regardless of webhook delivery status.

Open the Test webhook → Response panel to read the body. Slack and Teams always include a human-readable reason (e.g. invalid_blocks, Bad payload received by generic incoming webhook). Most often the JSON is valid but the shape doesn’t match what Slack/Teams expects.

Success badge green but nothing appears in the channel

Section titled “Success badge green but nothing appears in the channel”

Check the webhook URL. If it points to an archived channel or a deleted connector, Slack/Teams can return 200 ok but silently drop the message. Recreate the webhook in the target system and paste the new URL.