This post describes how to create a custom connector (API connector) to call the Azure APIM from PowerApps and Flows. This process is especially helpful to know when you would like to use the Azure APIM from a PowerApp and/or Flow and there is no connector available for the Azure APIM we wish to use.
Before creating custom connector in powerapps, the first step is registering your Azure APIM application in the Microsoft Azure Portal and keep the following security details handy in notepad
- Client ID
- Client secret
- Tenant ID
- Resource url
Let’s start step by step…
1. The first step is to export Swagger File(OpenApi 2.0) from Azure APIM of the API you wish to connect from PowerApps/Power Automate.
Create custom connector
2. In a web browser, open the PowerApps web app in Office 365
https://web.powerapps.com
3. Click Data, then click Custom Connectors
4. Click the + New custom connector link
5. Select Import an OpenApi file

6. Select the JSON file you exported in the first step
7. Enter the custom connector name
8. Click Continue

9. Change icon, color and description if required under General Tab
10. Verify Scheme, Host and Base URL

11. Click Security tab
12. In the Choose what authentication is implemented by your API dropdown list, select OAuth 2.0
13. In the OAuth 2.0 section, in the Identity Provider dropdown list, select Azure Active Directory
14. In the Client id text box, enter the Client Id you saved to Notepad
15. In the Client Secret text box, enter the Client secret you saved to Notepad
16. In the Scope text box, enter the permissions you configured when you made the application (Directory.Read.All, Group.Read.All)
17. In the Resource URL text box, enter Client ID fot Backend App Registration i.e. https://global.consent.azure-apim.net/redirect
18. Click Definition

19. Change the Operation Id to a valid name format. In this case, we use SearchPerson

20. Set if any http header needs to be passed with request

21. Click Create connector

22. Click the Test tab
23. Click New connection
24. Click Create
25. Sign in to your Office 365 account
26. Test Search Person operation

Custom connector is added to your data sources now.

Using Custom connector inside App
Let’s use the newly created Custom connector now
1. Create a new canvas app
2. Goto Connectors under Data sources and click on newly added Custom Connector

After adding the new Datasource a new item would be visible under In your App section.
3. Now add one Text Input and one Button control and one Gallery on the screen

4. Select the button’s OnSelect function and write the code shown in the screen below
In the code below we are calling the newly added Custom Connector’s Search Person Operation and the result is being stored inside a Collection. This collection it the datasource for the gallery on this screen.

5. Run the app and enter some text inside text input.
All matching records would be displayed in the gallery with Name, Image and status.

CONCLUSION
The Power Automate platform gives users an unprecedented way of automating business processes without the need to have coding knowledge. The platform gives the user the ability to create powerful workflows and connect to external systems like never before.
In this blog, I explained to you how you can formulate your custom connector for Power Apps through a series of steps. If you have any confusion, questions or insights, leave a comment below!
I enjoyed reading what you had to say. You are obviously very knowledgeable. Good job on this article! Your article has proven useful to me. Juditha Kenon Bradlee
I am glad that it helped you in some way.
You have observed very interesting details! ps decent web site. Melisenda Tannie Kizzie
Hope you find it useful.
There is definately a great deal to find out about this subject. I love all the points you have made. Gertruda Allen Stavro
Thanks, hope it helped you.
This is my first time visit at here and i am in fact happy to read all at alone place. Jewelle Filippo Chard
Thank you 🙂
I know this if off topic but I’m looking into starting
my own weblog and was curious what all is required to get setup?
I’m assuming having a blog like yours would cost a pretty penny?
I’m not very web savvy so I’m not 100% positive.
Any tips or advice would be greatly appreciated. Many thanks
Hi
Thanks for visiting.
To start your own website you need to do following things:
1. Buy a domain & website hosting it would cost you around USD10-15 per year
2. Use WordPress to make your log, it’s free.
i like this super article
This piece of writing is in fact a pleasant one it helps new internet visitors, who are wishing in favor of blogging. Naomi Homere Mariandi
This is my first time pay a quick visit at here and i am really pleassant to read all at alone place. Miranda Brian Rorry
I pay a quick visit every day some blogs and websites to read content, but this website gives feature based writing. Jessamine Dionisio Renae
Thank you for the kind words:)
Appreciation to my father who told me concerning this weblog, this blog is genuinely remarkable. Inga Baxy Bruckner
Glad it helped you, thank you:)
Not much to add, other than thank you for expressing this so eloquently, and I agree with every point you raise. Lindy Paquito Bette-Ann
Really appreciate your kind words:)
I will recommend your beautiful post site to my friends
Thank you, hope it helped you as well.
I really like the design and contents of your web page
Thank you.
I think it is a fluent sharing, I will recommend your site to my friends
Thank you.
I am incessantly thought about this, thanks for posting.
thank you.
I think it is a fluent sharing, I will recommend your site to my friends
Thank you.
I reckon something truly special in this website.
Thank you
Thanks again for the article. Really Cool.
Thanks for visiting, hope it helped you 🙂