When an Azure region has a bad day, your customers usually notice at the same time you do, or before. The signal already exists: Azure Service Health publishes outages, planned maintenance and advisories for the services and regions you actually use. The gap is getting it to where your team looks, which for most startups is Slack.
This post covers an open-source reference implementation, the design decisions behind it, its threat model, what it costs to run, and what I learned validating it end to end in a real tenant.
Repo: https://github.com/ricmmartins/azure-service-health-slack-bot
The practical result: the whole life of an incident (first notice, updates, resolution) stays in one Slack message and its thread, instead of a stream of repeated alerts.
What it does
- Sends Azure Service Health events to a Slack channel.
- Updates the original Slack message as the incident evolves and adds thread replies to preserve the event history.
- Routes by subscription, Azure service and region, so the payments team sees what matters to payments.
- Covers multiple subscriptions or a whole Management Group, and you can add more later.
Architecture
- An Azure Monitor Activity Log Alert matches ServiceHealth events.
- An Action Group calls a Secure Webhook, authenticated with Microsoft Entra.
- An Azure Container App validates the caller, parses the Common Alert Schema, routes, deduplicates and stores state in Azure Table Storage.
- The Slack API receives a root message plus thread updates.
The same path in more detail:
Design decisions and trade-offs
Why a Secure Webhook. I chose an Entra-authenticated Secure Webhook to deliver Service Health alerts directly to version-controlled application code. For this workload, it avoids adding a separately managed workflow component while keeping authentication and event processing explicit.
Container Apps instead of Functions or AKS. I wanted a plain containerized web app with managed ingress, managed identity and simple scaling, without running a cluster. The trade-off is that this is not scale-to-zero by default: the deployment keeps one replica (0.5 vCPU, 1 GiB) and scales to three. That is intentional. An alert receiver that cold-starts during an outage is the wrong place to save a few dollars.
Table Storage instead of a database. The state is small key-value data: the Slack message timestamp per incident, plus an operation journal. Tables are cheap, need no server, and support ETags for optimistic concurrency.
Idempotency is a requirement, not a feature. Azure can send duplicates and out-of-order updates. The app keeps each incident's state in Table Storage and uses ETag-based optimistic concurrency plus a short processing lease stored on the incident row, so concurrent deliveries do not create two root messages for one incident. This is best-effort protection against duplicates and races, not a guarantee of exactly-once delivery across every possible failure between Azure, the app and Slack. (Blob leases are used elsewhere: they serialize the subscription-management operations.)
Security model
The webhook has to be reachable by Azure Monitor, so it is public HTTPS. The controls are layered:
- Caller identity. The webhook is authenticated with Microsoft Entra, and the application itself validates every request: the token audience, the app role and the calling application's identity. Unauthenticated requests are rejected, and I verify that rejection during deployment.
- No shared secrets in code or config. The Slack token goes straight into Key Vault. The app reaches Key Vault, Storage and the registry through a user-assigned managed identity with least-privilege roles (Key Vault Secrets User, Storage Table Data Contributor, AcrPull).
- Private data plane. Key Vault and the Table Storage state account have public network access disabled and are reached through private endpoints and private DNS. The container registry has admin user and anonymous pull disabled.
- Guardrails against operator error. Every deployment stage checks the tenant and subscription first, so a stray azd up cannot land in the wrong environment.
Not everything is private, and I would rather say so: the registry and the observability resources keep public network access enabled, and the ingress is public by necessity.
Deploying it
You do not write or edit any Bicep. The runbook uses Bash, Azure CLI and azd (Linux, macOS, or Ubuntu on WSL) in short stages:
- Pin the tenant, subscription, region and environment name.
- Create the Slack app and note the channel ID.
- Install dependencies and configure non-secret inputs.
- Provision, then move the Slack token directly into Key Vault.
- Deploy the Container App.
- Verify health, auth rejection and a signed test delivery, then enable the alert.
Start here: docs/deployment-and-operations.md.
When it finishes, this is what you end up with in the resource group:
Everything the deployment created in the central resource group (az resource list): the Container App and its environment, Key Vault and Table Storage behind private endpoints, the Activity Log Alert and Action Group, and the monitoring resources. Subscriptions you add later get their own small resource group with just an Action Group and an Activity Log Alert.Adding subscriptions and Management Groups
Most startups begin with one subscription and grow into several, so you do not have to decide that on day one. The central deployment covers its own subscription. To cover more, you run a small management script from the repo (scripts/manage_alert_scopes.py) in the same Bash environment you used to deploy. It is not a one-shot command. Every change is a two-step, review-then-execute flow:
- Preview. Run the command with --what-if --json. Nothing is changed. It returns what would be created and a fingerprint.
- Review. Read the preview. For a Management Group it lists every descendant subscription it found.
- Execute. Run the same command again with --execution-fingerprint set to the reviewed value. The fingerprint is valid for 15 minutes and is tied to the exact tenant, environment and parameters you reviewed.
For a single subscription:
# 1. Preview (no changes)
python scripts/manage_alert_scopes.py add-subscription \
--subscription-id "<subscription-id>" \
--environment-name "$AZURE_ENV_NAME" --what-if --json
# 2. Execute with the fingerprint from the preview
python scripts/manage_alert_scopes.py add-subscription \
--subscription-id "<subscription-id>" \
--environment-name "$AZURE_ENV_NAME" \
--execution-fingerprint "<fingerprint-from-preview>"
For a Management Group, use add-management-group with --management-group-id (the group ID, not its display name) and follow the same two steps. list shows what is covered, and the remove-* and migrate-* commands work the same way.
What happens during execution: the tool creates a resource group, an Action Group and an Activity Log Alert in the target subscription, with the alert disabled. It then asks Azure to send an official signed test through the Action Group and enables the alert only if that test reaches the app. Migrations enable the replacement first and remove the old path afterwards, so there is no coverage gap.
Two things to know:
- Service Health alerts cannot be scoped to a Management Group. The tool expands the group into its subscriptions and creates a subscription-scoped alert path for each. If you later move a new subscription into the group, re-run add-management-group to pick it up.
- Your signed-in identity needs permission to create those resources in each target subscription. The command checks the Azure operations it needs before it changes anything.
The full procedure, with every command, is in docs/runbook/scopes.md.
Cost and operations
I am deliberately not quoting a monthly figure, because it depends on region and usage. The cost drivers are:
- Container Apps: one always-on replica (0.5 vCPU, 1 GiB), scaling to three.
- Private endpoints: two (Key Vault and Table Storage), billed hourly plus data processed.
- Container Registry: Basic SKU by default.
- Log Analytics and Application Insights: 30-day retention; cost follows ingestion volume.
- Key Vault, Storage Tables, Activity Log Alerts, Action Group: small at this volume.
Use the Azure pricing calculator with your region to get a real number. Operationally, the deployment ships its own health signals: an availability test on /healthz, plus alerts for webhook 5xx errors, dependency failures and replica count.
What validating it in a real tenant taught me
I ran the whole thing in a clean tenant, then repeated it with multiple subscriptions and a Management Group. Real runs found bugs a unit test never would:
- Raw HTML in Slack. Azure sends the communication field as HTML, and my first deploy showed <p> tags in the channel. The parser now converts it to plain text.
- Deployment name collisions. Subscription-level deployments with the same name cannot change region. Names now include the region.
- Expiring approvals mid-operation. A 15-minute review fingerprint is right for starting an operation but wrong to enforce halfway through a slow migration, where it left duplicate alerts. It now gates only the start; drift checks still run throughout.
If you document a deployment, run your own docs end to end. Every inconsistency I fixed came from doing exactly that.
Limits you should know
- It only fires for new events after the alert is enabled. It does not replay old ones.
- It covers what Service Health publishes: service issues, planned maintenance, health advisories, security advisories and billing updates (what appears in Service Health). Notices that Azure delivers outside Service Health do not reach Slack. For example, Microsoft documents that Azure OpenAI and Foundry abuse-monitoring notices go to the subscription's contacts by email, so I would not rely on this bot for them.
- Azure Service Health remains the source of truth. The bot does not acknowledge incidents or replace an incident management platform.
- You do not need to enable Activity Log or Log Analytics for the alert itself. Service Health events come from the Activity Log, which is always on.
Try it
- Clone the repo: https://github.com/ricmmartins/azure-service-health-slack-bot
- Check the prerequisites and the cost drivers above, and use the Azure pricing calculator for your region before provisioning anything.
- Open the deployment guide, docs/deployment-and-operations.md, and follow the first-deployment path.
- Send the signed test and watch it land in Slack.
This is a community reference implementation, not an official Microsoft product or service. It is not supported by Microsoft and comes with no SLA, warranty or guaranteed response time. Review it, test it in your own environment and adapt it before relying on it in production. Azure Service Health remains the source of truth. Issues and pull requests are welcome.