Skip to main content
All CollectionsIntegrate EverythingMicrosoft
Microsoft 365 Graph Subscription
Microsoft 365 Graph Subscription

Learn to integrate Microsoft Graph in Torq and utilize the steps in secure automated workflows.

Updated this week

Microsoft 365 is a cloud-based productivity suite that helps with tasks like document creation, collaboration, communication, and data management through tools such as Outlook, Entra ID, Excel, Teams, OneDrive and more.

Microsoft Graph is the API for most Microsoft 365 cloud-based product notification events. A Microsoft Graph trigger integration is necessary to trigger workflows from events sent by Outlook, OneDrive, SharePoint, etc.

To trigger a Torq workflow based on events sent from Microsoft 365 (using the Graph trigger integration), look here.

To use Microsoft 365 steps in Torq workflows, look here.

Trigger a Torq Workflow from Microsoft 365

Step One: Create a Microsoft 365 Application

  1. In Microsoft Azure: Go to your Azure portal and click App registrations.

  2. New Application: Click New registration and fill out the information.

    1. Give the application a unique and meaningful name.

    2. Give the account access Accounts in this organization directory only

    3. You do not need to enter a redirect URL.

  3. Create Application: Click Register.

  4. Grant Permissions: Under Manage, click API permissions. You will want to grant the application permissions here, depending on which Torq steps you want to use.

    1. Go to Add a permission, and click Microsoft Graph.

    2. Click Application permissions.

    3. See our extensive Microsoft Permissions document for details. The permissions you enable depend on your integration's purpose—Outlook, OneDrive, and general Microsoft 365 steps each require different permissions. While some overlap exists, it's best to enable only the permissions needed for each integration and application.

    4. Click Add Permissions.

  5. Grant Consent: Click Grant admin consent for {your org name}.

  6. Copy Info: From the Overview page of your application, copy the following information to use later in Torq:

    1. Application (client) ID

    2. Directory (tenant) ID

  7. Create a Client Secret: Go to Certificates & secrets and click New Client Secret.

    1. Give the secret an accurate description.

    2. Set the expiration date. It is recommended that you use a custom date in the extended future (but in compliance with your organization's policies).

    3. Click Add.

    4. Copy the generated secret.

Step Two: Create a Microsoft 365 Steps Integration in Torq

  1. Navigate to Integration: Go to Build > Integrations > Steps > Microsoft 365 and click Add.

  2. Fill in the Details: Follow the following steps to fill in the information.

    1. Give the integration a unique and meaningful name.

    2. Paste the Tenant ID you retrieved earlier.

    3. Paste the Client ID you retrieved earlier.

    4. Paste the Client Secret you retrieved earlier.

  3. Finalize: Click Add to save.

Step Three: Create a Microsoft 365 Graph Subscription Trigger Integration in Torq

Microsoft 365 Defender and Microsoft Defender for Endpoint have a dedicated step Create session that generates the access token required by their integration steps.

  1. Navigate to Integration: Go to Build > Integrations > Triggers > Microsoft 365 Graph Subscription, and click Add.

  2. Fill in the Details: Enter a unique and meaningful name for the integration.

    1. You will not be able to change this later.

  3. Finalize: Click Add.

Step Four: Import Torq's Subscription Renewal Template

Due to Microsoft's build, it is necessary to subscribe webhooks to events (create triggers) using API calls that refresh every few days. To make this process easier, Torq has created a template you can use to make one or more Microsoft Graph subscriptions to a Microsoft 365 integration.

  1. Import the Template: Import the Create Microsoft Graph Subscriptions and Renewals template into your workspace in Torq.

  2. Choose Timing: Set the timing for the workflow to run. It is recommended to run the workflow at least once every three days, if not daily.

  3. Set Parameters:

    1. Set the Microsoft 365 parameter as the steps integration you created earlier.

    2. Set the Torq parameter to your relevant Torq integration.

  4. Customize: Adjust the template as desired to set the Microsoft Graph subscriptions you want to trigger workflows.

    1. If you want to keep subscriptions more separated, you can create multiple Graph Subscription trigger integrations and subscribe each to a separate event.

Now that you've successfully created a Microsoft 365 trigger, you can build your first Microsoft-initiated workflow!

In Torq, go to Build > Workflows > Create a Workflow > New Blank Workflow, and select the trigger type: Integrations > Microsoft. Find your new trigger, and automate away!


FAQs


Templates

Now that you've added both step and trigger integrations, check out these templates specially crafted by Torq's security experts. Visit Torq's template library for more.

Did this answer your question?