Create a Custom Connector for your Web API from within Visual Studio

Hi Folks,

In this blog post, let’s see how we can create a custom connector without leaving our own Visual Studio for building a custom connector. Ideally for building any custom connector, we need to create them in https://make.powerapps.com or https://make.powerautomate.com. Last month Microsoft Announced that Power Platform is now a connected service in Visual Studio 2022. In this blog, we will utilize its capability…

Before diving deeper, let’s see what are the prerequisites..

  1. Visual Studio
  2. ASP .NET Web API knowledge
  3. Canvas Apps knowledge

Let’s get started..

Step 1:

Create ASP.NET Web API Project in Visual Studio

Step 2:Choose your option as below and click on Next..

Step 3:

Choose your next steps as below and click on Next to proceed, make sure to choose authentication type as None

Step 4:

Create a ASP.NET Core Web API Project

Step 5:

By adding Power Platform as a service dependency, you can update an existing custom connector, or create a new one from your API.

If you want to expose your local running API to a public endpoint, I prefer using Dev Tunnels feature of Visual Studio…

That’s it, you have started running your API.

Step 6:

Now let’s create a Mobile App with Power Apps…with the same login you have used for the Visual Studio to create a custom connector..

Step 7:

First check if Custom Connector has been created in your tenant and authenticate the connection….navigate to https://make.powerapps.com and click on Discover at the left of the page….and then click on Custom Connectors, you should see a connector which we created from Visual Studio….nice isn’t it…

Step 8:

All you need to create a connection by clicking on the + sign available..

Once connected, now try creating a mobile Canvas App..

In the Canvas App, try adding data…and search for Weather Sample which you created, you should see something like below…

Step 9:

Once the web API is running in your development environment, you can debug in real time and even Hot Reload your code.

References:

https://learn.microsoft.com/en-us/aspnet/core/test/dev-tunnels?view=aspnetcore-7.0#create-a-tunnel

Thank you for reading…

Cheers,

PMDY


Discover more from ECELLORS CRM Blog

Subscribe to get the latest posts to your email.

Author: Pavan Mani Deep Y

Passionate for Power Platform. A technology geek who loves sharing the leanings, quick tips and new features on Dynamics 365 & related tools, technologies. An Azure IOT and Quantum Computing enthusiast...

Leave a comment

Discover more from ECELLORS CRM Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading