- 31 Jan 2023
- 2 Minutes to read
- DarkLight
Microsoft Graph
- Updated on 31 Jan 2023
- 2 Minutes to read
- DarkLight
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.
2. Register a new app
Click App registrations > + New registration.
3. Configure the app
- Enter a meaningful name for the app.
- Select the necessary supported account types. For more information, click Help me choose.
- Click Register.
4. Add Microsoft Graph application permissions
- Click API permissions > + Add permissions > Microsoft Graph.
- 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.
5. Grant admin consent
Click Grant admin consent for {organization name}.
6. Create a client secret
- From the left panel, click Certificates & secrets.
- Click + New client secret.
- Configure the client secret.
- Enter a meaningful description.
- 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).
- Click Add.
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.
Use 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.
1. Create a Microsoft 365 integration
Perform these steps in Torq.
- Go to Integrations and locate the Microsoft 365 card, and click Add.
- Enter a meaningful name for the integration.
- Enter the Tenant ID, Client ID, and Secret Value.
- Click Add.
2. Use Microsoft steps in a workflow
Perform these steps in Torq.
- Go to the canvas of an existing workflow or create a new workflow.
- In the Steps Library, search for the Microsoft 365 integration and drag the step Generate Access Token to the canvas.
- Select the integration that you created in the previous step.
- 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 }}