Bemærk
Adgang til denne side kræver godkendelse. Du kan prøve at logge på eller ændre mapper.
Adgang til denne side kræver godkendelse. Du kan prøve at ændre mapper.
This article walks through how to set up a blank app from Vite and turn it into a Power Apps code app. It covers configuring a TypeScript app using the Power Platform SDK.
Note
Preview features aren’t meant for production use and may have restricted functionality. These features are available before an official release so that customers can get early access and provide feedback.
Prerequisites
- Power Platform environment with code apps enabled
- Node.js Long term support (LTS) version
- Power Platform CLI
- Git
Steps
Open a new terminal and enter:
npx degit github:microsoft/PowerAppsCodeApps/templates/vite my-app cd my-appAuthenticate the Power Platform CLI against your Power Platform tenant and select your environment:
pac auth create pac env select --environment {environment id}Sign in using your Power Platform account when prompted. All Power Platform apps, flows, and agents publish to an environment. The PAC CLI's auth command prompts you to authenticate with your Microsoft Entra identity and ensure the code app you add connections to and publish to Power Platform go in the specified environment.
Install the Power SDK and initialize your code app using:
npm install pac code init --displayname "App From Scratch"Enter the following to test your code app locally:
npm run dev
Then, open the URL labelled Local Play.
Important
Open the URL in the same browser profile as your Power Platform tenant.
You should see the app open similar to:
Build and deploy to Power Apps
In the terminal window, run these commands:
npm run build | pac code push
- npm run build Runs the scripts configured in the
package.jsonfile with the key value ofbuild. In this case, the script is"tsc -b && vite build". - pac code push Publishes a new version of a Code app.
If successful, this command should return a Power Apps URL to run the app.
Optionally, you can open Power Apps to see the app. You can play, share, or see details from there.
Congratulations! You successfully pushed your first code app!