Azure Logic Apps Integration Guide

Logic Apps service is an automation design solution for Microsoft Azure that allows building powerful automated workflows and business processes with a visual designer, without needing to write any code. Logic Apps provides the ability to interface with PagerDuty through PagerDuty’s REST API and Events API (v1), and to perform a variety of actions such as:

  • Starting workflows based on events that occur in PagerDuty, such as incident creation, assignment of an incident to a user, or resolution of an incident;
  • Obtaining user and incident data
  • Incident operations, such as:
    • Acknowledge
    • Reassign
    • Resolve
    • Snooze
    • Add a note
    • Escalate

In PagerDuty

Create a REST API Key

This API key will be used by Azure Logic Apps to communicate with PagerDuty.

  1. From the Configuration menu in PagerDuty, select API Access.API Access menu item
  2. On the API Access page, click the Create New API Key button. button: Create API key
  3. In the dialog that pops up, you’ll be prompted to enter a Description for your key, and for the API version select v2. You will also have the option to create the key as Read-only; leave this box unchecked as a full-access API key is required. modal: Create API Key
  4. Once you have filled in your options, click Create Key.
  5. Once you click Create Key, you will see a dialog displaying your key and confirming the options you filled in on the previous step.
  6. Important: Make sure to copy this key and save it in a secure place, as you will not have access to the key after this step. If you lose a key that you created previously and need access to it again, you should remove the key and create a new one.
  7. Click Close once you have successfully copied your key.

Create an Events API Integration

To trigger incidents as stages in your workflow, you will need to create an Events API (v1) integration as well:

  1. Create a new service in your PagerDuty account, or open an existing service, to integrate with Logic Apps.
  2. Go to the Integrations tab of the service.
  3. Obtain an Events API integration key:
    • If you have an existing v1 Events API integration, copy its Integration Key.
    • Otherwise, click New Integration, select Use our API directly / Events API v1 for the Integration Type, click Add Integration and copy the key of the newly-made integration.

In Azure

  1. Go to Logic Apps and create a new Logic App, or modify a new one, and at the desired workflow stage click New Step.
  2. Search for “PagerDuty”. Logic Apps: Select Action
  3. Pick a PagerDuty action.
  4. If you have not yet created an API connection for PagerDuty in your Azure account, you will be prompted to add one by entering a Connection Name and API Key. In the PagerDuty API Key field, enter the REST API key that you created in the steps above. Logic Apps: Create new API connection
  5. If the action is to create an incident, you will be prompted to enter your Events API key (a.k.a. Integration Key) created in the above steps. Enter it into the Service key field. Logic Apps: Create Incident
  6. If the action is to Get user by ID, you can obtain the user’s ID from the URL of their user profile page. It is the alphanumeric code at the end of the URL that begins with P, i.e. P93V6LZ.

You should now be able to perform any of the listed API-enabled actions in PagerDuty as part of automated workflows in Azure Logic Apps.