jpda / azure-tag-manager

Manages tags on Azure resources automatically.
Apache License 2.0
1 stars 1 forks source link

alternatives to azure monitor alerts #13

Closed jpda closed 5 years ago

jpda commented 5 years ago

maybe event grid?

jpda commented 5 years ago

maybe not. schema for event grid azure subscription level events includes write events, but no way to distinguish between 'RG created' and 'resource written.' sticking to azure monitor for now, i guess

jpda commented 5 years ago

sample on create:

{
  "subject": "/subscriptions/<sub_id>/resourceGroups/test-create",
  "eventType": "Microsoft.Resources.ResourceWriteSuccess",
  "data": {
    "authorization": {
      "scope": "/subscriptions/<sub_id>/resourceGroups/test-create",
      "action": "Microsoft.Resources/subscriptions/resourceGroups/write"
    },
    "httpRequest": {
      "method": "PUT",
      "url": "https://management.azure.com/subscriptions/<sub_id>/resourceGroups/test-create?api-version=2014-04-01-preview"
    },
    "resourceProvider": "Microsoft.Resources",
    "resourceUri": "/subscriptions/<sub_id>/resourceGroups/test-create",
    "operationName": "Microsoft.Resources/subscriptions/resourceGroups/write",
    "status": "Succeeded",
    "subscriptionId": "<sub_id>",
    "tenantId": "<tenant_id>"
  },
  "dataVersion": "2",
  "metadataVersion": "1",
  "topic": "/subscriptions/<sub_id>"
}

sample on edit:

{
  "subject": "/subscriptions/<sub_id>/resourcegroups/test-create",
  "eventType": "Microsoft.Resources.ResourceWriteSuccess",
  "data": {
    "authorization": {
      "scope": "/subscriptions/<sub_id>/resourcegroups/test-create",
      "action": "Microsoft.Resources/subscriptions/resourcegroups/write"
      },
    "httpRequest": {
      "method": "PUT",
      "url": "https://management.azure.com/subscriptions/<sub_id>/resourcegroups/test-create?api-version=2017-05-10"
    },
    "resourceProvider": "Microsoft.Resources",
    "resourceUri": "/subscriptions/<sub_id>/resourcegroups/test-create",
    "operationName": "Microsoft.Resources/subscriptions/resourcegroups/write",
    "status": "Succeeded",
    "subscriptionId": "<sub_id>",
    "tenantId": "<tenant_id>"
  },
  "dataVersion": "2",
  "metadataVersion": "1",
  "topic": "/subscriptions/<sub_id>"
}