• Products
  • Get started
  • Documentation
  • Resources

Integrate Opsgenie with Microsoft Azure OMS

Azure OMS logo


What does the integration offer?

Use the Azure OMS Integration to forward Azure OMS alerts to Opsgenie. Opsgenie determines the right people to notify based on on-call schedules - using email, text messages (SMS), phone calls, iOS & Android push notifications, and escalates alerts until they are acknowledged or closed.

How does the integration work?

When an alert is created in Azure OMS, an alert is automatically created in Opsgenie.

Set up the integration

Azure OMS is an API-based integration. Setting it up involves the following steps:

  • Add an Azure OMS integration in Opsgenie

  • Configure the integration in Azure OMS

Add an Azure OMS integration

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 add this integration from your team dashboard only. The Integrations page under Settings is not available in your plan.

  1. Go to Teams and select your team.

  2. Select Integrations on the left navigation and then select Add integration.

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. Follow the rest of the steps in this section to set up the integration.

To add an Azure OMS in Opsgenie:

  1. Go to Settings > Integrations.

  2. Select Add integration.

  3. Run a search and select “Azure OMS”.

  4. On the next screen, enter a name for the integration.

  5. Optional: Select a team in Assignee team if you want a specific team to receive alerts from the integration.

  6. Select Continue.
    The integration is saved at this point.

  7. Expand the Steps to configure the integration section and copy the Webhook URL.
    You will use this URL while configuring the integration in Azure OMS later.

  8. Select Turn on integration.
    The rules you create for the integration will work only if you turn on the integration.

Configure the integration in Azure OMS

1. On the Azure Portal, select Logic Apps.

2. Create a logic app.

3. Select Consumption for the plan type.

4. Open the logic app and select Azure Monitor - Metrics Alert Handler for the template.

5. Select Add a new step and select HTTP REST request.

6. Select POST for the method.

7. Paste the URL you copied while adding the integration in Opsgenie into URI.

8. Copy-paste the following into the body:

1 2 3 4 5 6 7 8 9 10 11 12 { "alertRuleName": "§§@{triggerBody()['data']['essentials']['alertRule']}§§", "alertThresholdOperator": "§§@{triggerBody().data.alertContext.condition.allOf[0].operator}§§", "alertThresholdValue": "§§@{triggerBody().data.alertContext.condition.allOf[0].threshold}§§", "linkToSearchResults": "§§@{triggerBody().data.alertContext.condition.allOf[0].linkToSearchResultsUI}§§", "resultCount": "§§@{triggerBody().data.alertContext.condition.allOf[0].metricValue}§§", "searchIntervalEndtimeUtc": "§§@{triggerBody()['data']['alertContext']['condition']['windowEndTime']}§§", "searchIntervalInSeconds": "§§@{dateDifference(triggerBody()['data']['alertContext']['condition']['windowStartTime'], triggerBody()['data']['alertContext']['condition']['windowEndTime'])}§§", "searchIntervalStartTimeUtc": "§§@{triggerBody()['data']['alertContext']['condition']['windowStartTime']}§§", "searchQuery": "§§@{triggerBody().data.alertContext.condition.allOf[0].searchQuery}§§", "workspaceID": "§§@{triggerBody().data.alertContext.condition.allOf[0].operator}§§" }

9. Select Save.

10. Go to Analytics workspace.

11. Create a query and select New Alert rule.

12. Add conditions against which you want to create alerts.

13. Go to the Actions tab.

14. Select Create Action Group and add actions.
While adding actions, select Logic app for the action type and select the logic app you created earlier.

15. Select Save.

Sample payload sent from Azure OMS

Create alert payload (in JSON format)

1 2 3 4 5 6 7 8 9 10 11 12 { "alertRuleName":"§§#alertrulename§§", "alertThresholdOperator":"§§#thresholdoperator§§", "alertThresholdValue":"§§#thresholdvalue§§", "linkToSearchResults":"§§#linktosearchresults§§", "resultCount":"§§#searchresultcount§§", "searchIntervalEndtimeUtc":"§§#searchintervalendtimeutc§§", "searchIntervalInSeconds":"§§#searchinterval§§", "searchIntervalStartTimeUtc":"§§#searchintervalstarttimeutc§§", "searchQuery":"§§#searchquery§§", "workspaceID":"§§#workspaceid§§" }

Still need help?

The Atlassian Community is here for you.