Skip to content

An adapter to forward Azure Monitor Autoscale events to Azure Event Grid.

License

Notifications You must be signed in to change notification settings

tomkerkhove/azure-monitor-autoscale-to-event-grid-adapter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Event Grid adapter for Azure Monitor Autoscale

Bring Azure Monitor Autoscale events to Azure Event Grid with this adapter.

Deploy to Azure

How Does It Work?

An Azure Logic Apps workflow is used to receive the webhooks, interpret them and convert it to a CloudEvent.

Overview

Supported Events

  • Scale In Activated
  • Scale Out Activated

Scale In 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}"
            }
        }
    }
}

Scale Out Activated

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}"
            }
        }
    }
}

About

An adapter to forward Azure Monitor Autoscale events to Azure Event Grid.

Resources

License

Code of conduct

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published