

Create a Microsoft Power App for your ASP.NET Core Web API
source link: https://devblogs.microsoft.com/visualstudio/create-a-microsoft-power-app-for-your-asp-net-core-web-api/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Create a Microsoft Power App for your ASP.NET Core Web API

Julia Kasper
Boost your developer journey by easily creating front ends for your web APIs.
Low-code tooling is becoming increasingly popular among developers because it allows them to create applications faster and with less code. In Visual Studio 2022 17.6 preview 2, you can now connect to the Microsoft Power Platform via connected services and create custom connectors based on your ASP.NET web API. You can download the latest preview at Visual Studio Preview.
In today’s blog post, we will cover prerequisites, how to create the custom connector from within Visual Studio and how to quickly build a front-end using Microsoft Power Apps.
Prerequisites
- Visual Studio 2022 version 17.6 Preview 2 or later with the ASP.NET and web development workload installed. You need to be signed into Visual Studio to create and use dev tunnels. The feature isn’t available in Visual Studio for Mac.
- An ASP.NET Core Web API project
- A Microsoft Power Platform environment. More information: Create a developer environment.
How-to create a custom connector for Microsoft Power Platform
- For our connection to work, we will have to use or create an NET Web API project in Visual Studio. For my example, I am using the generic ASP.NET Web API weather template:
- In Solution Explorer double click on Connected Services and click on + in Service Dependencies.
- Next, I am adding Microsoft Power Platform as a Connected Services. The connection will ask you to define the following configurations:
-
- Select a Power Platform environment. Note: If you don’t have a Power Platform environment available, you can easily create a developer environment to get started with.
- Select or create a new custom connector
- Create or select a dev tunnel with the following configurations:
- Tunnel type: Persistent
- Access type: Public
Note: Visual Studio leverages dev tunnels feature to expose your local running API to a public endpoint. It means you can use Power Apps with your API running in your local environment.
After you hit the Finish Button, you are now Connected to the Microsoft Power Platform. As soon as you hit F5 or the Play Button, a custom connector will be created in the Power Platform environment you selected earlier. Go to Microsoft Power Apps to see your custom connector and create a front end.
Note: As soon as you close the solution and reopen it, you should enable the tunnel again.
Create a mobile app by using Power Apps and integrate with your ASP.NET web API
With your web API running locally, you are now able to quickly create a Power App using Microsoft Power Apps:
- Open Microsoft Power Apps and select your environment where you created your custom connector in:
- Next, we will + Create a new Blank Canvas App and select Phone as our layout.
- Then, we will add our custom connector to our Power App via the Add data button and search for our custom connector name.
- We will continue by inserting a Button. In the menu, select Insert > Button. Drag and drop the button to the bottom of the form. Change the Text to Load Data.
- Add the following formula to the OnSelect property:ClearCollect(weatherCollection, WeatherSample_Connector.GetWeatherForecast())
- In the menu, select Insert Vertical Gallery. Select the weatherCollection as the data source. Change the layout to title and subtitle.
Run the app and you are now able to see the results while running your web API locally. Once the web API is running in your development environment, you can debug in real time and even Hot Reload your code.
What’s next?
For detailed documentation, check out Visual Studio connected service (preview) – Power Platform | Microsoft Learn and Create a canvas app front end for your ASP.NET web API (preview) – Power Platform | Microsoft Learn. In the future, we will work on an integration with your CI/CD pipeline and Azure API Management. Let us know if you have any feedback or future support requests.
Feedback
Most of the updates that we will deliver in the future will be inspired by feedback. You can share feedback with us via Developer Community: report any bugs or issues via report a problem and share your suggestions for new features or improvements to existing ones.
You can also leave a comment here or reach out to [email protected]. Or you can reach out to Julia on LinkedIn @jukasper.
Happy coding.
Julia Kasper Program Manager
Follow
Recommend
-
4
Create a temp directory for your app in Node.js May 23 Originally published at
-
16
Create a Checklist App with Power Apps and SQL Server By: Hristo Hristov | Updated: 2021-07-09 |
-
7
Scale your app with multi-coreA quick note about myselfI’m a self-taught developer based in Paris, I worked as a freelancer for a few years, before starting to work for my family's company Place-des-Arts....
-
8
C# Corner ASP.NET Core 5 Microsoft Power BI Reporting Eric Vogel provides step-by-step instructions to create an ASP.NET...
-
6
lovers14Create a custom app for you and your loved ones for free
-
9
How to Create Your First Successful Mobile AppMarch 26th 2022 new story0It is essential to have a...
-
9
A free app to upgrade your brain powerA free app to upgrade your mental power and achieve peak performance.
-
6
Step-by-Step to Create Your First Power BI DashboardSkip to content
-
6
通过轻松创建 Web API 前端来提升您的开发体验。 低代码工具在开发人员中越来越流行,因为用更少的代码更快地创建应用程序。在 Visual Studio 2022 17.6 预览版2中,您现在可以通过连接服务连接到 Microsoft Power Platform,并基于 ASP .NET Web API...
-
7
Create Power Microsoft Platform dataflows from queries in Microsoft Excel (Preview) Art...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK