megel / powerapps-helper

MIT License
27 stars 3 forks source link

PowerApps Helper VSCode Extension

The PowerApps Helper VSCode Extension help you to download & upload Solutions and PowerApps from your PowerApp Environment. Furthermore, the extension uses Power Platform Cli from Microsoft to extract as Canvas Apps downloaded in msapp (Archive) format well as to pack the extracted source code into msapp format for the upload.

Prerequisites

PowerApps Helper uses the authentication from ms-vscode.azure-account (Azure Account Extension). That means before you can start, please ensure that your VSCode is authenticated at your Azure Active Directory that is connected to your Dataverse environment.

Sign-In:

Execute [Ctrl+Shift+P] Azure: Sign in in VSCode and authenticate with your account at your Azure Active Directory.

Select Tenant:

Execute [Ctrl+Shift+P] Azure: Sign in in VSCode and select / change your current AAD tenant.

Features

The added view "Power Apps Environments" provides information about your Power Apps Environments.

Commands

The extension adds the PowerApps View to VSCode, which gets a list of your PowerApps Environments from PowerApps API

PowerApps View

Use the PowerApps-Language-Tooling to Downloaded and Unpack Solutions to your local project:

Download and Unpack Solution

You can PowerApps-Language-Tooling as well to Downloaded and Unpack a PowerApp to your local project. This makes sense, when you want to add manual a Canvas App to your solution.

Download and Unpack App

As result you get your PowerApp sources as follows:

PowerApp Sources

Tooltips

The PowerApps Helper VSCode extension provides also a couple of useful information as well as links. Here is an example:

Environment

Requirements

This extension uses the PowerApps API to excess your PowerApps Environment:

  1. PowerApps for App Makers - Get Apps to provide PowerApp information to the VSCode Extension PowerApps Tree
  2. PowerApps for App Makers - Get App Versions to provide PowerApp Version information to the VSCode Extension PowerApps Tree

Furthermore, it uses the PowerApps-Language-Tooling to extract the PowerApp from msapp (Archive) format into YAML. Read more about this on: Source code files for Canvas apps. This is done by referencing Power Platform Extension from Microsoft and using the included/installed PAC CLI. It is installed in Windows underneath c:\Users\<YOUR USERNAME>\AppData\Roaming\<VS CODE FOLDER>\User\globalStorage\microsoft-isvexptools.powerplatform-vscode\pac\tools\.

Finally, Azure Account VS-Code extension is required to acquire a Bearer Token for the PowerApps API requests.

Power Apps

The PowerApps are provided by PowerApps API: https://api.powerapps.com/providers/Microsoft.PowerApps/apps/?api-version=2020-07-01

A documentation can be found at:

PowerApps for App Makers - Get Apps

Power App Versions

The PowerApp Versions are provided by PowerApps API: https://api.powerapps.com/providers/Microsoft.PowerApps/apps/{app}/versions?api-version=2020-07-01

A documentation can be found at:

PowerApps for App Makers - Get App Versions

Power Apps APIs

The Power Apps APIs are provided by Power Apps for Makers API: https://api.powerapps.com/providers/Microsoft.PowerApps/apis/{connector}?$filter=environment eq '{environmentName}'&api-version=2020-07-01

A documentation can be found at:

PowerApps for App Makers - Get Connectors

Extension Settings

This extension contributes the following settings:

Settings

API Connection Settings (OAuth Settings, ...)

Uses this setting to avoid a reentering of ClientId and/or TenantId for each Custom Connectors in a new Crm-Environment. You can specify the used ClientId and/or TenantId for "Update OAuth Settings" for Custom Connectors by:

{
   "mme2k-powerapps-helper.APIConnectionSettings": {
        // Environment name where the setting is used
        "Default-525232c0-41a9-4573-9484-8b571b4691c2": {
            // "Xrm-ConnectorId.Authentication": ... "3a4b7fd3-f303-4269-b1ac-91ec8ef15a06.oauth.aad"
            //   or
            // "Authentication" ... "oauth.aad"
            "oauth.aad": {
                "clientId": "10996272-a6ac-425f-933f-17ae3f5f6724", // overrule the clientId
                "tenantId": "abce06a2-ff58-48b6-9ca0-ca4d8608f2d6"  // overrule the tenantId, when tenantId != common
            }
        }
  }
}

Note: Use the tooltips of Environment and Custom Connector to get the needed information for the setting.

Visualize Dataverse Environments

Note: You need Graphviz for this feature installed on your local machine or a microservice including a rendering API (details coming soon).

To use this feature, run "Power Apps: Visualize Dataverse Environments" from command pallet or open by clicking on an environment or a solution: Settings

Visualize Dataverse Environments collects information about solutions and their dependencies from the selected environment. This might take a while. Afterwards, all solutions are shown in this overview: Settings

Use this list to select / unselect solutions for the graph rendering. To render an overview graph, press: "Solution Graph". As result, all selected solutions and their component dependencies are shown: Settings

Clicking on a solution opens a detailed view of its dependencies to other / from other solutions. Settings

I hope you like this new feature. Please provide feedback or contribute here on Github!

Known Issues

Release Notes

The extension is currently in development.

Change Log