Bring Azure Monitor Autoscale events to Azure Event Grid with this adapter.
An Azure Logic Apps workflow is used to receive the webhooks, interpret them and convert it to a CloudEvent.
- Scale In Activated
- Scale Out Activated
Event Type: Azure.Monitor.Autoscale.ScaleIn.Activated
Payload
{
"specversion": "1.0",
"type": "Azure.Monitor.Autoscale.ScaleIn.Activated",
"id": "A234-1234-1234",
"subject": "/autoscalesettings/{autoscale-rule-name}",
"source": "azure-monitor-autoscale-to-event-grid-adapter",
"time": "2018-04-05T17:31:00Z",
"datacontenttype": "application/json",
"data": {
"name": "{autoscale-rule-name}",
"details": "Autoscale successfully started scale operation for resource '{resource-name}' from capacity '2' to capacity '1'",
"metadata": {
"tenant": "Contoso",
"region": "Europe"
},
"capacity": {
"new": 1,
"old": 2
},
"scaleTarget": {
"subscriptionId": "{subscription-id}",
"resourceGroupName": "{resource-group-name}",
"resource": {
"id": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-type}/{resource-name}",
"type": "{resource-type}",
"name": "{resource-name}",
"region": "{region-name}",
"portalLink": "https://portal.azure.com/#resource/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-type}/{resource-name}"
}
}
}
}
Event Type: Azure.Monitor.Autoscale.ScaleOut.Activated
Payload
{
"specversion": "1.0",
"type": "Azure.Monitor.Autoscale.ScaleOut.Activated",
"id": "A234-1234-1234",
"subject": "/autoscalesettings/{autoscale-rule-name}",
"source": "azure-monitor-autoscale-to-event-grid-adapter",
"time": "2018-04-05T17:31:00Z",
"datacontenttype": "application/json",
"data": {
"name": "{autoscale-rule-name}",
"details": "Autoscale successfully started scale operation for resource '{resource-name}' from capacity '1' to capacity '2'",
"metadata": {
"tenant": "Contoso",
"region": "Europe"
},
"capacity": {
"new": 2,
"old": 1
},
"scaleTarget": {
"subscriptionId": "{subscription-id}",
"resourceGroupName": "{resource-group-name}",
"resource": {
"id": "/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-type}/{resource-name}",
"type": "{resource-type}",
"name": "{resource-name}",
"region": "{region-name}",
"portalLink": "https://portal.azure.com/#resource/subscriptions/{subscription-id}/resourceGroups/{resource-group-name}/providers/{resource-type}/{resource-name}"
}
}
}
}