• Products
  • Get started
  • Documentation
  • Resources

Integrate Opsgenie with Microsoft Azure Event Hubs

Azure Event Hubs logo

For an alert rule on a metric value, when the value of a specified metric crosses a threshold assigned, the alert rule becomes active and sends a notification. For an alert rule on events, a rule can send a notification on every event, or, only when a certain number of events happen.

​What does Opsgenie offer Azure Event Hubs users?

Azure Event Hubs can generates alerts based on metrics. Opsgenie acts as a dispatcher for the alerts generated by Azure. Opsgenie determines the right people to notify based on on-call schedules and escalations and notifies via using email, text messages (SMS), phone calls, and Android & iOS push notifications.

Opsgenie Supports the new Azure metric alerts as well:

With the Azure new metric alerts, new fields are added in the new Azure payload. Hence, you can accordingly configure the Opsgenie integration to support them.
For more info visit: https://docs.microsoft.com/en-us/azure/monitoring-and-diagnostics/monitoring-near-real-time-metric-alerts#payload-schema

Functionality of the integration

When an alert is created in Azure Event Hubs, an alert is created in Opsgenie automatically through the integration.

Add Azure Event Hubs integration in Opsgenie

You can add this integration from your team dashboard

If you're using Opsgenie's Free or Essentials plan, or if you’re using Opsgenie with Jira Service Management's Standard plan, you can only add this integration from your team dashboard as the Integrations page under Settings is not available in your plan.

Adding the integration from your team dashboard will make your team the owner of the integration. This means Opsgenie will assign the alerts received through this integration to your team only.

To do that,

  1. Go to your team’s dashboard from Teams,

  2. Select Integrations, and select Add integration.

Follow the rest of the steps to complete the integration.

  1. Go to Settings > Integrations. Search for Azure Event Hubs and select Add.

  2. Specify who is notified of Microsoft Azure alerts using the Responders field. Auto-complete suggestions are provided as you type.

  3. Copy the integration URL.

  4. Select Save Integration.

Configuration in Azure

Note: Azure webhook alerts are only available via the Azure Preview Portal. If using the classic version, please use the Email integration.

  1. Log in to Azure portal.

  2. Search for Event hub in portal search and go to your event hubs, and select your event hubs namespace for which you want to add alert.

Microsoft Azure Event Hubs portal search

3. Select the Alerts section under Monitoring.

Microsoft Azure Event Hubs Monitor

4. Select Manage Actions tab and click to Add action group, you can choose to edit an existing action group.

Microsoft Azure Event Hubs manage actions

5. Create a new action by adding Action Type as Webhook and click Edit Details to configure.

Microsoft Azure Event Hubs action type

6. Add the webhook url copied from Opsgenie integration settings to URI field. (Here you may choose to enable common alert schema).

Microsoft Azure Event Hubs webhook

7. Choose Manage alert rules from Alerts section under Monitoring and choose to create or edit an alert rule.

Microsoft Azure Event Hubs rules

8. Choose the condition on which you want to create alert by clicking on Select condition and select the metric.

Microsoft Azure Event Hubs configure signal logic

9. Add desired Threshold value , Aggregation type and Aggregation period and save. You may choose to add multiple conditions on different metrics.

Microsoft Azure Event Hubs Configure Conditions

Sample payload sent from Azure Metric Alert

Create Alert payload:


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 { "schemaId": "AzureMonitorMetricAlert", "data": { "version": "2.0", "properties": null, "status": "Activated", "context": { "timestamp": "2020-06-24T10:28:19.3462700Z", "id": "/subscriptions/25b83e19-ab0d-4579-ad81-asdas-sadasda/resourceGroups/test_eventhub_group/providers/microsoft.insights/metricalerts/test-eventhub-alerts", "name": "test-eventhub-alerts", "description": "test description for alert", "conditionType": "SingleResourceMultipleMetricCriteria", "severity": "3", "condition": { "windowSize": "PT1M", "allOf": [{ "metricName": "SuccessfulRequests", "metricNamespace": "Microsoft.EventHub/namespaces", "operator": "GreaterThan", "threshold": "2", "timeAggregation": "Total", "dimensions": [{ "name": "ResourceId", "value": "25b83e19-ab0d-4579-ad81-d0280e506bb3:test-eventhub-og" }, { "name": "EntityName", "value": "test-eventhub" }, { "name": "OperationResult", "value": "Success" }], "metricValue": 8.0, "webTestName": null }, { "metricName": "IncomingRequests", "metricNamespace": "Microsoft.EventHub/namespaces", "operator": "GreaterThan", "threshold": "3", "timeAggregation": "Total", "dimensions": [{ "name": "ResourceId", "value": "25b83e19-ab0d-4579-ad81-d0280e506bb3:test-eventhub-og" }, { "name": "EntityName", "value": "test-eventhub" }], "metricValue": 8.0, "webTestName": null }] }, "subscriptionId": "25b83e19-ab0d-4579-ad81-d0280e506bb3", "resourceGroupName": "test_eventhub_group", "resourceName": "test-eventhub-og", "resourceType": "Microsoft.EventHub/namespaces", "resourceId": "/subscriptions/25b83e19-ab0d-4579-ad81-d0280e506bb3/resourceGroups/test_eventhub_group/providers/Microsoft.EventHub/namespaces/test-eventhub-og", "portalLink": "https://portal.azure.com/#resource/subscriptions/25b83e19-ab0d-4579-ad81-d0280e506bb3/resourceGroups/test_eventhub_group/providers/Microsoft.EventHub/namespaces/test-eventhub-og" } } }

Sample payload sent from Azure Common Alert Schema


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 { "schemaId": "azureMonitorCommonAlertSchema", "data": { "essentials": { "alertId": "/subscriptions/25b83e19-ab0d-4579-ad81-d0280e506bb3/providers/Microsoft.AlertsManagement/alerts/7ccad036-8973-49e9-b628-a18350fb32bb", "alertRule": "test-eventhub-alerts", "severity": "Sev3", "signalType": "Metric", "monitorCondition": "Fired", "monitoringService": "Platform", "alertTargetIDs": ["/subscriptions/25b83e19-ab0d-4579-ad81-d0280e506bb3/resourcegroups/test_eventhub_group/providers/microsoft.eventhub/namespaces/test-eventhub-og"], "originAlertId": "25b83e19-ab0d-4579-ad81-d0280e506bb3_test_eventhub_group_microsoft.insights_metricalerts_test-eventhub-alerts_-121967519", "firedDateTime": "2020-06-29T18:41:05.7016722Z", "description": "", "essentialsVersion": "1.0", "alertContextVersion": "1.0" }, "alertContext": { "properties": null, "conditionType": "SingleResourceMultipleMetricCriteria", "condition": { "windowSize": "PT1M", "allOf": [{ "metricName": "SuccessfulRequests", "metricNamespace": "Microsoft.EventHub/namespaces", "operator": "GreaterThan", "threshold": "2", "timeAggregation": "Total", "dimensions": [{ "name": "ResourceId", "value": "25b83e19-ab0d-4579-ad81-d0280e506bb3:test-eventhub-og" }, { "name": "EntityName", "value": "test-eventhub" }, { "name": "OperationResult", "value": "Success" }], "metricValue": 4.0, "webTestName": null }], "windowStartTime": "2020-06-29T18:38:52.06Z", "windowEndTime": "2020-06-29T18:39:52.06Z" } } } }

Sample alert

Microsoft Azure Event Hubs sample alert


Additional Help