Microsoft Graph
  • 31 Jan 2023
  • 2 Minutes to read
  • Dark
    Light

Microsoft Graph

  • Dark
    Light

Article Summary

Microsoft Graph is the mechanism by which you access APIs for the majority of Microsoft services, which you'll use as steps in your workflows. 

In order to use Microsoft steps in your workflows, you'll need to register a new app in Azure AD, add Microsoft Graph permissions to the app, and grant admin consent. After you register the app, you'll create your integrations in Torq.

This article explains how to set up everything you need in order to use Microsoft steps in a workflow and how to use the steps in a workflow.

Configure Microsoft Graph in the Azure Portal

In your Azure portal, you'll register a new app and add API permissions to Microsoft Graph.

1. Access your Azure portal

Log in to your Azure Portal and access Azure AD.

graph-azure-ad-portal2. Register a new app

Click App registrations > + New registration.

Screenshot of registering a new app in Azure AD.3. Configure the app

🗒️ NOTE
When configuring the app, you don't have to use the redirect URL option.
  1. Enter a meaningful name for the app.
  2. Select the necessary supported account types. For more information, click Help me choose.
  3. Click Register.

Screenshot showing how to register the app you created.4. Add Microsoft Graph application permissions

  1. Click API permissions > + Add permissions > Microsoft Graph.graph-application-permissions
  2. Click Application permissions and select the permissions required for the Microsoft services for which you'll need to access the API in your Torq workflows, and click Add permissions.Screenshot of adding permissions to the app.

5. Grant admin consent

Click Grant admin consent for {organization name}.

Screenshot showing how to grant admin consent for the app.6. Create a client secret

⚠️ IMPORTANT
Copy the client secret value and store it in a safe place. You might not be able to access it again. You need the client secret when configuring a Microsoft 365 integration in Torq.
  1. From the left panel, click Certificates & secrets.
  2. Click + New client secret.Screenshot showing how to create a client secret.
  3. Configure the client secret.
  4. Enter a meaningful description.
  5. Set the expiration date for the client secret. It is recommended that you use a custom date in the extended future (but in compliance with your organization's policies).
  6. Click Add.

Screenshot showing how to copy the client secret.7. Copy the app IDs

You'll need several IDs and the client secret in order to create a Microsoft 365 integration in Torq. Click Overview to view the Application (client) ID and Directory (tenant) ID.

graph-copy-app-idsUse Microsoft steps in a Torq workflow

In Torq you'll create and configure Microsoft 365 integration, which is used to generate the access token for most Microsoft steps, and integrations with the Microsoft services you need, for example, Outlook, Teams, OneDrive, Intune, and so on.

🗒️ NOTE
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. Create a Microsoft 365 integration

Perform these steps in Torq.

  1. Go to Integrations and locate the Microsoft 365 card, and click Add.
  2. Enter a meaningful name for the integration.
  3. Enter the Tenant ID, Client ID, and Secret Value.
  4. Click Add.

graph-create-integration2. Use Microsoft steps in a workflow

Perform these steps in Torq.

  1. Go to the canvas of an existing workflow or create a new workflow.
  2. In the Steps Library, search for the Microsoft 365 integration and drag the step Generate Access Token to the canvas.
  3. Select the integration that you created in the previous step.
  4. Add the Microsoft steps you need and populate the MSGRAPH_ACCESS_TOKEN input parameter with the token created in the previous step. {{ $.generate_access_token.api_object.access_token }}



Was this article helpful?

What's Next
Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.