Practice Lab 6 - Power Platform tools

Scenario

As we continue to build our solution, we will now install and configure tools used for extending the Power Platform with code.

High-level lab steps

We will install and configure the following tools:

  • Power Platform CLI
  • Configuration Migration Tool
  • XrmToolBox
  • DotNet Framework
  • Visual Studio Code

Things to consider before you begin

  • Which tools do you require?
  • Which IDE(s) do you require?

Exercise 1: Power Platform CLI

Objective: In this exercise, you will install the Power Platform CLI.

Task 1.1: Download and install Power Platform CLI

  1. Download the Power Platform CLI https://aka.ms/PowerAppsCLI.
  2. Run the powerapps-cli-1.0.msi to start the installation.
  3. Use the setup wizard to complete the setup and select Finish.
  4. Open a Command Prompt.
  5. Verify Power Apps CLI is installed.

    pac install latest
    
  6. List the Power Apps CLI tools.

    pac tool list
    

    pac tools - screenshot

    [!NOTE] Power Platform tools will be installed on first launch.

Exercise 2: Configuration Migration Tool

Objective: In this exercise, you will copy reference data between environments.

Task 2.1: Export data from Development

  1. Open a Command Prompt.
  2. Launch the Configuration Migration Tool with the following command.

    pac tool cmt
    

    Configuration Migration Tool - screenshot

  3. Select Create schema and select Continue.
  4. Select Office 365 for Deployment Type.
  5. Check Display list of available organizations.
  6. Check Show Advanced.
  7. Enter your tenant credentials.

    Tools login - screenshot

  8. Select Login.

    Tools environments - screenshot

  9. Select your Development environment and select Login.
  10. Select the Permit Management solution.
  11. Select the Build Site table under Select Entity.
  12. Select Build Site, City, Country/Region, State/Province, Street Address, ZIP/Postal Code columns.
  13. Select Add Fields >.

    Configuration Migration Tool table and columns- screenshot

  14. Select the Permit Type table under Select Entity.
  15. Select Name, Permit Type, Require Inspections, Require Size columns.
  16. Select Add Fields >.
  17. Select Save and Export.
  18. Enter permit.xml and select Save.
  19. Select Yes to export the data.
  20. Select the ellipses next to Save to data file.
  21. Enter permitdata.zip.
  22. Select Save.

    Configuration Migration Tool export - screenshot

  23. Select Export Data.
  24. Select Exit.

Task 2.2: Import data to Production

  1. Open the Command Prompt.
  2. Run the command pac tool cmt.
  3. Select Import data
  4. Select Continue.
  5. Select Office 365 for Deployment Type.
  6. Check Display list of available organizations.
  7. Check Show Advanced.
  8. Enter your tenant credentials.
  9. Select Login.
  10. Select your Production environment and click Login.
  11. Select the ellipses next to Zip File.
  12. Select the permitdata.zip file you created in the previous task and click Open.
  13. Select Import data
  14. Select Exit.
  15. Close the Configuration Migration Tool window.

Exercise 3: Community tools

Objective: In this exercise, you will use FetchXmlBuilder in the XrmToolBox to find inspections with status reason New request or Pending.

Task 3.1: Install XrmToolBox

  1. Navigate to XrmToolBox https://www.xrmtoolbox.com

    XrmToolBox website - screenshot

  2. Download the latest version of XrmToolBox.
  3. Right click on the XrmToolBox.zip file and select Properties.
  4. Select Unblock and Apply.
  5. Extract the XrmToolBox.zip file to a folder.
  6. Run XrmToolBox.exe from the folder.

    XrmToolBox app - screenshot

  7. Select Open Tool Library.
  8. Search for fetchxml and select FetchXML Builder by Jonas Rapp.

    XrmToolBox Tool Library - screenshot

  9. Select Install.
  10. Select Yes.
  11. Select Close.
  12. Search for early and select Early Bound Generator by Daryl LaBar.
  13. Select Install.
  14. Select Yes.
  15. Select Close.
  16. Search for trace and select Plugin Trace Viewer by Jonas Rapp.
  17. Select Install.
  18. Select Yes.
  19. Select Close.
  20. Close the Tool Library tab.

Task 3.2: FetchXML query

  1. Select the Tools tab in XRMToolBox.
  2. Search for fetchxml and select FetchXML Builder.
  3. Select Yes to Do you want to connect to an organization first?.
  4. Select Open Connection Manager.
  5. Select Create a new connection.
  6. Select Microsoft Login Control.
  7. Click Open Microsoft Login Control.
  8. Select Office 365 for Deployment Type.
  9. Check Display list of available organizations.
  10. Check Show Advanced.
  11. Enter your tenant credentials.
  12. Click Login.
  13. Select your Development environment and select Login.
  14. Enter Dev for Name and select Finish.
  15. Select Close.
  16. Select the Dev connection.
  17. Select OK.
  18. Select Continue.

    FetchXML Builder - screenshot

  19. Click on the (entity) node.
  20. Select contoso_inspection in the Entity name drop down.
  21. Click on filter.
  22. Select statuscode in the Attribute drop down.
  23. Select Equal in the Operator drop down.
  24. Select New Request in the Value drop down.
  25. Click on +condition.
  26. Select statuscode in the Attribute drop down.
  27. Select Equal in the Operator drop down.
  28. Select Pending in the Value drop down.
  29. Click on the filter node.
  30. Select or in the Filter type drop down.

    FetchXML Builder query - screenshot

  31. Select View and then select FetchXML. The FetchXML should look like the following query.

    <fetch top="50">
      <entity name="contoso_inspection">
        <filter type="or">
          <condition attribute="statuscode" operator="eq" value="1" />
          <condition attribute="statuscode" operator="eq" value="330650001" />
        </filter>
      </entity>
    </fetch>
    
  32. Select Execute (F5). You should see a list of inspection records.

  33. Select Convert and then select Power Automate Parameters. The filter should look like the following

    (statuscode eq 1 or statuscode eq 330650001)
    

Exercise 4: .NET Framework

Objective: In this exercise, you will install the supported .NET Framework.

[!NOTE] The virtual machine used in the lab environment has Visual Studio 2019 Community Edition installed. The labs are have been verified against this version of Visual Studio. If you are using a different version or edition of Visual Studio, the steps may differ.

Task 4.1: Install .NET Framework

  1. Install .NET Framework 4.6.2 Developer Pack

    • Navigate to .NET Framework 4.6.2 Downloads https://dotnet.microsoft.com/download/dotnet-framework/net462.

    • Select the Developer Pack.

    Developer pack - screenshot

    • Open the downloaded file.
    • Follow the steps in setup wizard to complete installing the Developer Pack.

Task 4.2: Install .NET Framework in Visual Studio

  1. Add .NET Framework 4.6.2 to Visual Studio 2019.

    • Start Visual Studio Installer.
    • Select Modify.
    • Under Installation details pane, check .NET Framework 4.6.2 development tools.
    • Select Modify.
    • Select Yes
    • Close the Visual Studio Installer window.

Exercise 5: Visual Studio Code

Objective: In this exercise, you will install the Visual Studio Code IDE.

[!NOTE] If you already have Visual Studio Code installed, you can skip this exercise.

Task 5.1: Install Visual Studio Code

  1. Download Visual Studio Code.

  2. Open the downloaded file.

  3. Follow the steps in setup wizard to complete installing Visual Studio Code.