I’ve documented the process of creating a custom connector, which I developed when needing to use Graph API information in Power Apps.
Register Your App with Azure
First, let’s register your application with Azure.
Then, select “App registrations”,
Choose “New registration”,
Give your app an appropriate name and register it. Note: The redirect URL will be configured later. <
img src="https://ippu-biz.com/wp-content/uploads/2020/10/cc001.png" alt="" width="952" height="684" class="alignnone size-full wp-image-897" />
Once the app is registered, note down the Client ID (Application ID) and navigate to “Certificates & secrets”.
Click on “New client secret”,
Set an appropriate expiration date and add it.
A client secret key will be generated – make sure to note this down as well.
Now, let’s switch over to Power Apps.
Creating a Power Apps Custom Connector
In Power Apps, navigate to [Data] -> [Custom connectors], then select [New custom connector] -> [Create from scratch].
Give it an appropriate name.
You’ll be taken to this screen, where you should enter:
- Scheme: HTTPS
- Host: graph.microsoft.com
Then click “Security”.
Select “OAuth 2.0” as the authentication type.
Configure the remaining information as follows:
- Identity Provider: Azure Active Directory
- Client id: The client ID you noted from Azure AD
- Client secret: The secret key you noted from Azure AD
- Login URL and Tenant ID: Leave as default
- Resource URL: https://graph.microsoft.com
- Scope: https://graph.microsoft.com/.default
Then click “Create connector”.
A redirect URL will be generated – note this down and return to Azure.
Azure Redirect URL Configuration
After returning to Azure, select [Authentication] from the left menu and click [Add a platform].
Select Web for Web applications,
Enter the redirect URL you noted earlier and click [Configure].
Update: Adding API Permissions in Azure
The following section covers the necessary settings for calling Graph API through your custom connector.
When calling GraphAPI from the custom connector, you need to configure permissions for each API as shown below.
Click [Add a permission],
Select [Microsoft Graph],
Choose [Delegated permissions],
Grant read permission for Presence.
Now you can use this custom connector to retrieve Presence information and display status indicators like “Available”.
Note: Required permissions vary depending on the Graph API you want to use, so different settings may be necessary for other APIs.
With the Graph API connection now complete, let’s return to Power Apps to test the connection.
Power Apps Connection Test
Back in Power Apps, select [4. Test] -> [New connection].
Click Create,
Select an account with appropriate permissions.
Then grant authorization.
Success!
The custom connector for Graph API has now been created successfully.
The specific API definitions and usage instructions will be covered in separate articles.
コメント