In this exercise, you will create a new custom connector which can be used in Microsoft Power Automate or in Azure Logic Apps. The OpenAPI definition file is prebuilt with the correct path for the Microsoft Graph $batch
endpoint and additional settings to enable simple import.
Open a browser and navigate to Microsoft Power Automate. Sign in with your Microsoft 365 tenant administrator account. Choose Custom connectors on the left-hand side menu. If Custom connectors isn't present in the menu, select More, then Discover all.
There are two options to create a custom connector for Microsoft Graph:
- Create from blank
- Import an OpenAPI file
On the Custom Connectors page choose the New custom connector link in the top right, then select the Create from blank item in the drop-down menu.
Enter MS Graph Batch Connector
in the Connector name text box. Choose Continue.
On the connector configuration General page, fill in the fields as follows.
- Scheme: HTTPS
- Host:
graph.microsoft.com
- Base URL:
/
Choose Security button to continue.
On the Security page, fill in the fields as follows.
- Choose what authentication is implemented by your API:
OAuth 2.0
- Identity Provider:
Azure Active Directory
- Client id: the application ID you created in the previous exercise
- Client secret: the key you created in the previous exercise
- Login url:
https://login.windows.net
- Tenant ID:
common
- Resource URL:
https://graph.microsoft.com
(no trailing /) - Scope: Leave blank
Choose Definition button to continue.
On the Definition page, select New Action and fill in the fields as follows.
- Summary:
Batch
- Description:
Execute Batch with Delegate Permission
- Operation ID:
Batch
- Visibility:
important
Create Request by selecting Import from Sample and fill in the fields as follows.
- Verb:
POST
- URL:
https://graph.microsoft.com/v1.0/$batch
- Headers: Leave blank
- Body:
{}
Select Import.
Choose Create Connector on the top-right.
Using a text editor, create a new empty file named MSGraph-Delegate-Batch.swagger.json
and add the following code.
:::code language="json" source="./src/LabFiles/MSGraph-Delegate-Batch.swagger.json":::
On the Custom Connectors page choose the New custom connector link in the top right, then select the Import an OpenAPI file item in the drop-down menu.
Enter MS Graph Batch Connector
in the Connector name text box. Choose the folder icon to upload the OpenAPI file. Browse to the MSGraph-Delegate-Batch.swagger.json
file you created. Choose Continue to upload the OpenAPI file.
On the connector configuration page, choose the Security link in the navigation menu. Fill in the fields as follows.
- Choose what authentication is implemented by your API:
OAuth 2.0
- Identity Provider:
Azure Active Directory
- Client id: the application ID you created in the previous exercise
- Client secret: the key you created in the previous exercise
- Login url:
https://login.windows.net
- Tenant ID:
common
- Resource URL:
https://graph.microsoft.com
(no trailing /) - Scope: Leave blank
Choose Create Connector on the top-right.
After the connector has been created, copy the generated Redirect URL from the Security tab.
Go back to the registered application in the Microsoft Entra Portal you created in the previous exercise. Select Authentication on the left-hand side menu. Select Add a platform, then select Web. Enter the redirect URL copied from the previous step in the Redirect URIs, then select Configure.