Event Grid Capacity/Scaling Event Response
Subscribed to Event Grid events from autoscale and resource health (scale-out, scale-in, resource unhealthy), the flow notifies the on-call team, logs the scaling action, and opens an incident if a resource is degraded. Connects Azure scaling and health signals to operational response.
Provided as-is, without warranty of any kind. Review and test each pattern in a non-production environment before deploying it to live automations. See our Terms.
Overview
This flow connects Azure scaling and resource-health signals to operational response via Azure Event Grid. It subscribes (subscription-scope webhook) to autoscale events (scale-up/scale-down initiated, completed, failed) and Resource Health availability-changed events. For every event it logs an audit row to Dataverse, opens a Capacity Incident only when the resource is genuinely degraded, and posts a red/green alert to the on-call Teams channel.
Why it matters: scaling and health events usually go unseen until something breaks. Routing them to people - with an incident opened only for real degradation - keeps ops ahead of capacity and reliability issues without alert noise.
Ships Off (demo).
Use Case
An ops/SRE team wants visibility and action on Azure scaling and resource-health events: awareness for every scale action, an auditable history for capacity planning, and an incident record only when a resource is actually unavailable or degraded.
Flow Architecture
When a Scaling or Health Event Occurs
Azure Event Grid - CreateSubscription (webhook)Subscription-scope webhook receiving autoscale and Resource Health availability-changed events; splitOn runs each event independently.
Initialize Trace & Classify
Initialize variableMints a correlation id and resolves event type, subject, resource URI, health status, degraded-status list, event category, and is-degraded across payload shapes.
Log Scaling Event
Microsoft Dataverse - CreateRecordLogs every event (with the raw payload) to the scaling-event table.
Open Capacity Incident If Degraded
Condition + Microsoft Dataverse - CreateRecordWhen the health status matches a degraded status, opens a Capacity Incident (severity High, status Open).
Notify On-Call Team
Microsoft Teams - PostMessageToConversationPosts a red/green alert with an Incident opened flag to the on-call channel.
Environment Variables
| Schema name | Type | Default | Description |
|---|---|---|---|
| flowlibs_AzureSubscriptionId | String | <your-subscription-id> | Azure subscription used for the Event Grid topic scope. |
| flowlibs_EventGridResourceType | String | Microsoft.Resources.Subscriptions | Resource type for the subscription-scope topic. |
| flowlibs_TeamsGroupId | String | <your-team-id> | Teams team/group id for the notification. |
| flowlibs_OnCallChannelId | String | <your-channel-id> | Teams channel id for on-call notifications. |
| flowlibs_ScalingEventTable | String | flowlibs_scalingevents | Entity set name of the scaling-event log table. |
| flowlibs_CapacityIncidentTable | String | flowlibs_capacityincidents | Entity set name of the capacity incident table. |
| flowlibs_DegradedHealthStatuses | String | Unavailable,Degraded | Comma-separated statuses that open an incident. |
Connectors & Connections
| Connector | API name | Actions used |
|---|---|---|
| Azure Event Grid | shared_azureeventgrid | CreateSubscription (trigger) |
| Microsoft Dataverse | shared_commondataserviceforapps | CreateRecord |
| Microsoft Teams | shared_teams | PostMessageToConversation |
Note — All connections are referenced as solution connection references; the flow is portable between environments as long as a connection is mapped at import time.
Customization Guide
Almost every realistic variant of this flow can be implemented by changing environment variable values. A few cases require small edits inside the flow definition — those are called out explicitly below.
- Cost insight
- Derive scale-out cost impact from the event count/category over time off the scaling-event table.
- Flapping detection
- Query recent scaling-event rows by resource to detect rapid scale oscillation.
- PagerDuty / ServiceNow
- Extend the degraded branch to page or open an external ticket on critical health events.
- Tune degradation
- Edit the degraded health statuses list to change which statuses open an incident.
- Scope
- Point the Event Grid resource type/topic at a specific resource group or resource instead of the whole subscription.
Key Expressions
The flow is intentionally light on Power Fx / WDL gymnastics — the heaviest expressions are the branch-name concatenation and the approval outcome check. They are listed below in the order they appear in the flow.
EXPR.01Is degraded (comma-boundary match)
Avoids Available matching Unavailable by comparing comma-bounded tokens.
EXPR.02Resource URI (cross-shape)
Resolves the affected resource across event payload shapes.
EXPR.03Health status (cross-shape)
Resolves availability/health status across payload shapes.
Comments
Sign in to join the conversation.
Sign inNo comments yet. Be the first to share your experience with this flow.