Power Apps recently released a preview feature called “Code Apps” that enables building web applications, so I decided to create an actual app to try it out.
Code Apps (Preview)
Code Apps is a new application format that allows you to host full-code web applications built with React and other frameworks on the Power Platform, while integrating them with Power Platform’s authentication, connectors, and management capabilities for distribution.
While the Power Apps Component Framework creates components that run within Power Apps canvas or model-driven apps, Code Apps enables building complete web applications from the ground up.

In this article, I’ll walk through creating a Code Apps application and building a web app that runs on Power Apps.
Prerequisites
- Install the latest version of Power Platform CLI
- Enable Code Apps in the environment where you’ll upload the app
- Note down the GUID of the environment where you’ll upload the app
Install the Latest Version of Power Platform CLI

Enable Code Apps in the Target Environment
Next, enable Code Apps on the Power Platform side.



Note Down the Environment GUID

That completes the prerequisites.
Building the App
Launch the Sample App
First, let’s follow the official reference guide to launch the sample app provided by Microsoft locally.

git clone https://github.com/microsoft/PowerAppsCodeApps.git


pac auth create --environment [Environment GUID]


pac code init --displayName '[App Name]'

npm run dev | pac code run


Building a Chat App with Azure OpenAI (AOAI)
Let’s take it a step further by customizing the sample app to create a chat application.

Upload the App to Power Platform
Finally, let’s upload the created app to Power Apps.

npm run build | pac code push

This exciting new feature, “Code Apps,” is likely to become the standard approach for internal applications where users have paid licenses, rather than using Azure Web Apps.

コメント