Incidents.AzureIntegration
An Azure integration turns alerts from Azure Monitor into Better Stack
incidents. Better Stack gives you a webhookUrl (a secret, Redacted):
in Azure, add a Webhook action with that URL to the action group your
alert rules use. Fired alerts open an incident, resolved alerts resolve
it.
Every prop updates in place except teamId, which replaces the
integration (and gives it a new webhookUrl). name defaults to a
generated unique name. Removing escalationPolicyId or teamWait clears
them. Without an escalation policy, call/sms/email/push/
criticalAlert decide how the current on-call person is alerted.
Creating a Azure integration
Section titled “Creating a Azure integration”Alert through an escalation policy
const integration = yield* BetterStack.Incidents.AzureIntegration("azure", { name: "Azure alerts", escalationPolicyId: policyId,});Pasting the webhook URL into Azure
Section titled “Pasting the webhook URL into Azure”The URL is a secret: export it from the stack and paste it into Azure, or hand it to whatever provisions Azure.
A stack output
const integration = yield* BetterStack.Incidents.AzureIntegration("alerts", { escalationPolicyId: policyId });return { webhookUrl: integration.webhookUrl };Pausing
Section titled “Pausing”Stop opening incidents during maintenance
yield* BetterStack.Incidents.AzureIntegration("azure", { name: "Azure alerts", paused: true });call boolean
Whether to call the on-call person. Ignored while an escalation policy is set.
criticalAlert boolean
Whether to send a critical push notification that ignores the mute switch and Do Not Disturb mode. Ignored while an escalation policy is set.
email boolean
Whether to send an e-mail to the on-call person. Ignored while an escalation policy is set.
escalationPolicyId string | null
ID of the escalation policy for alerts, or null to alert the current on-call person directly.
name string
Integration name. Defaults to a unique name generated from the stack, stage and logical id.
paused boolean
Whether the integration is paused. A paused integration opens no incidents.
push boolean
Whether to send a push notification to the on-call person. Ignored while an escalation policy is set.
recoveryPeriod number | null
Seconds a resolved alert must hold before the incident resolves. Has no effect for this integration, since an incident resolves as soon as Azure reports the alert as resolved.
sms boolean
Whether to send an SMS to the on-call person. Ignored while an escalation policy is set.
teamId string
Team that owns the resource, such as t123. Defaults to the credentials' team (BETTERSTACK_TEAM_ID, or the profile's team). Changing it replaces the resource.
teamWait number | null
Seconds to wait before escalating to the whole team. 0 alerts the whole team right away, and null never escalates to the team. Ignored while an escalation policy is set.
Attributes
Section titled “Attributes”id string always set
The incidents_azure_integration's id.
call boolean
Whether to call the on-call person. Ignored while an escalation policy is set.
criticalAlert boolean
Whether to send a critical push notification that ignores the mute switch and Do Not Disturb mode. Ignored while an escalation policy is set.
email boolean
Whether to send an e-mail to the on-call person. Ignored while an escalation policy is set.
escalationPolicyId string | null
ID of the escalation policy for alerts, or null to alert the current on-call person directly.
name string | null
Integration name.
paused boolean
Whether the integration is paused. A paused integration opens no incidents.
push boolean
Whether to send a push notification to the on-call person. Ignored while an escalation policy is set.
recoveryPeriod number | null
Seconds a resolved alert must hold before the incident resolves. Has no effect for this integration, since an incident resolves as soon as Azure reports the alert as resolved.
sms boolean
Whether to send an SMS to the on-call person. Ignored while an escalation policy is set.
teamId string
Team that owns this integration, such as t123.
teamName string
Name of the team that owns this integration.
teamWait number | null
Seconds to wait before escalating to the whole team. 0 alerts the whole team right away, and null never escalates to the team. Ignored while an escalation policy is set.
webhookUrl string | Redacted<string>
The URL to paste into Azure. Alerts Azure sends to it open incidents.
Lookup
Section titled “Lookup”AzureIntegration.lookup(props) reads an object this stack does not manage. It is never created, updated or deleted.
id string required
The integration's id.
teamId string
Team that owns it, such as t123. Defaults to the credentials' team.