Exercise - Use source code to create an app and install tools

Completed

In this exercise scenario, you have been asked to create an account management app for your organization. One development requirement within your organization is for the source of any in-house app to be available in text format. This requirement allows the company to perform an automatic scan of the source code for potential copyright infringement.

You decided to create a canvas app and to make the app source available in text format.

Requirement

To complete this exercise, make sure that you have a Microsoft Dataverse environment with database installed.

Objectives

The goals for this exercise are for you to learn how to:

  • Create a canvas application and download it to your computer.

  • Install the Power Platform extension for Visual Studio Code.

  • Unpack a canvas application in Visual Studio Code.

Exercise 1: Create an app

In this exercise, you'll create an account management canvas application and save it to your local machine.

Task: Create an application

In this task, you'll create an application and save it to your local machine.

  1. Go to Power Apps maker portal, sign in, and then select the environment that you want to use for this lab.

  2. Select Create > Dataverse.

    Screenshot of Power Apps maker portal home page with the Dataverse link highlighted.

  3. Create a New connection or select an existing connection.

  4. Select the Accounts table and then select Connect.

  5. Once the app is created, select the arrow beside the Save icon at the top-right of your screen, select Download a copy.

    Screenshot of the Save as screen with This computer selected.

  6. Select Download.

  7. Create a new folder on your computer and name it Learn lab account manager.

  8. Move the downloaded app to the folder that you created.

    Screenshot of the downloaded application.

Exercise 2: Install tools and unpack

In this exercise, you'll install Visual Studio Code, install the Power Platform extension for Visual Studio, and then unpack the canvas application.

Task: Install tools

In this task, you'll install Visual Studio Code.

  1. Go to Download Visual Studio Code - Mac, Linux, Windows, and then select the download for your platform.

  2. Follow prompts to install Visual Studio Code.

  3. Start Visual Studio Code after installation completes.

  4. Select the View menu and then select Extensions. Search for and select Power Platform.

    Screenshot of the Power Platform extension for Visual Studio.

  5. Select Install and then wait for the installation to complete.

    Screenshot of the Install button for the Power Platform extension.

  6. Select the File menu and then select Open Folder.

  7. Select the Learn lab account manager folder that you created previously.

  8. Select the Terminal menu and then select New Terminal.

    Screenshot of the New Terminal button.

  9. Run the following command to unpack the Account manager application.

    pac canvas unpack --msapp "Account manager.msapp" --sources src

  10. The unpack process should succeed. Expand the src folder that was created.

    Screenshot of the folder that was created by the unpack command.

  11. Expand each folder inside the src folder and then examine the content of each.