Set up ALM accelerator for Microsoft Power Platform (preview)

The ALM Accelerator for Microsoft Power Platform components enable makers to apply source-control strategies with Azure DevOps, and use automated builds and deployment of solutions to their environments without the need for manual intervention by the maker, administrator, developer, or tester. In addition, the ALM accelerator helps makers work without intimate knowledge of the downstream technologies and be able to switch quickly from developing solutions to source-controlling the solution and, ultimately, pushing their apps to other environments with as few interruptions to their work as possible.

Note

The ALM accelerator for Microsoft Power Platform is currently in public preview. While in preview we will be prioritizing feedback and bugs via GitHub New issue. If the issue is something in the platform all we can do is funnel feedback to the responsible product teams. For more information on the current preview status of the ALM Accelerator for Power Platform follow this link. The ALM accelerator doesn't have a dependency on other components of the CoE Starter Kit. It can be used independently.

Document structure

This setup guide is structured into seven main sections:

Prerequisites

Dataverse environments

The ALM accelerator for Microsoft Power Platform must be installed into a Power Platform environment with a Microsoft Dataverse database. From this environment, the ALM Accelerator for Power Platform app can be used to deploy solutions from development to validation to testing to production. All of these environments will also require a Dataverse database to deploy your solutions.

Note

Currently, the ALM accelerator isn't compatible with Dataverse for Teams. Both the ALM Accelerator for Power Platform app and the associated Azure DevOps pipelines assume that the full version of Dataverse is being used in all environments. You'll need to create an environment in which to set up the ALM accelerator for Microsoft Power Platform. We recommend that you install the accelerator in the same environment as other CoE Starter Kit solutions. For more information about how to decide on the best strategy for your organization, go to Establishing an environment strategy for Microsoft Power Platform and Environment strategy for ALM.

Azure DevOps organization

The ALM accelerator uses Azure DevOps for source control and deployments (pipelines). You can sign up for Azure DevOps for free for up to five users on the Azure DevOps site.

Users and permissions

To complete the steps in this section, you'll need the following users and permissions in Microsoft Power Platform, Azure DevOps, and Azure:

  • A licensed Azure user with permissions to create and view Azure AD groups, create app registrations, and grant admin consent to app registrations in Azure AD.
  • A licensed Azure DevOps user with permissions to create and manage pipelines, service connections, repos, and extensions.
  • A licensed Microsoft Power Platform user with permissions to create application users and grant administrative permissions to the application user.

Connectors and data loss prevention policy

For the ALM Accelerator for Power Platform canvas app to work, the following connectors must be available to be used together in the environment into which the ALM accelerator is imported:

Creator Kit

The ALM Accelerator includes features that required the installation of the Creator Kit in the environment where you install ALM Accelerator for Power Platform.

To install the Creator Kit follow steps described here : Install Creator Kit

Azure AD App Registration setup

The following steps guide you through setting up the Azure Active Directory App Registration for use with the ALM accelerator for Power Platform. These steps are general to the functionality of the ALM accelerator, and aren't project-specific or solution-specific.

Create an app registration in your Azure AD environment

Creating an app registration for the ALM accelerator is a one-time setup step to grant permissions to the app and the associated pipelines, permissions required to perform operations in Azure DevOps and Power Apps or Dataverse. The following steps show how to create a single app registration with permissions for both Dataverse and Azure DevOps. However, you might want to separate responsibilities specifically into Dataverse and Azure DevOps by creating separate app registrations.

Note

When separating the responsibilities of Azure App registration you should consider both maintenance and security aspect. Read the Considerations for App Registrations page to understand more.

  1. Sign in to the Azure portal.

  2. Go to Azure Active Directory > App registrations.

  3. Select New registration, and then give the registration a name, such as ALMAcceleratorServicePrincipal. Leave all other options as default, and then select Register.

  4. Select API permissions > + Add a permission.

  5. Select Dynamics CRM, and configure permissions as follows:

    • Select Delegated permissions.
    • Select user_impersonation.
  6. Select Add permissions.

  7. Repeat the preceding steps for the following permissions:

    • PowerApps-Advisor (Analysis All). This is required for running static analysis via the app checker. This permission can be found under APIs my organization uses.

    • DevOps. This is required for connecting to Azure DevOps via the custom connector in the ALM accelerator app. This permission can either be found under Microsoft APIs or under APIs my organization uses.

      If adding the Azure DevOps permissions from the APIs my organization uses list you should copy the Application (client) ID for later use.

      Important

      You'll use this value later and specifically call it out as the DevOps Application (client) ID, which is different from the Application (client) ID you'll copy in step 12 of this procedure. Copy the Application client ID.

      If you cannot find the Azure DevOps permissions in the APIs my organization uses you can get the DevOps Application (client) ID by following these steps:

      1. Open a private browser session and go to https://dev.azure.com/[your devops organization]/_apis
      2. After being redirected to the login page, copy the value of the client_id parameter in the url on the login page

      Copy the value of the client id parameter.

  8. After adding permissions in your app registration, select Grant Admin consent for (your tenant).

  9. Select Certificates & Secrets, and then select New client secret.

  10. Set the Expiration, and then select Add.

  11. After adding the secret, copy the value and store it for safekeeping to be used later.

  12. Return to the Overview section of your app registration, and copy the Application (client) ID and Directory (tenant) ID.

    Important

    You'll use this value later and call it out as the Application (client) ID, which is different from the DevOps Application (client) ID you copied earlier in step 7.

  13. Select Add a Redirect URI > Add a Platform > Web.

  14. Set the Redirect URI to https://global.consent.azure-apim.net/redirect.

    Note

    You might need to update this later when configuring your custom connector after you've installed the app, if this URL is different from the Redirect URI populated in the custom connector.

  15. Select Configure.

Give Power App Management Permission to your App

In order for the pipelines to perform certain actions against the environments (for example, Sharing Apps and setting component ownership) in your Power Platform tenant you will need to grant Power App Management permissions to your App registration. To do so you will need to run the following PowerShell cmdlet as an interactive user that has Power Apps administrative privileges. You will need to run this command once, using an interactive user, in PowerShell after your app registration has been created. The command gives permissions to the Service Principal to be able to execute environment related functions including querying for environments and connections via Microsoft.PowerApps.Administration.PowerShell. Learn more: New-PowerAppManagementApp cmdlet

Important

Currently this cmdlet gives elevated permissions (for example, Power Platform Admin) to the app registration. Your organization's security policies may not allow for these types of permissions. Ensure that these permissions are allowed before continuing. In the case that these elevated permissions are not allowed certain capabilities won't work in the AA4PP pipelines.

Install-Module -Name Microsoft.PowerApps.Administration.PowerShell
Install-Module -Name Microsoft.PowerApps.PowerShell -AllowClobber
New-PowerAppManagementApp -ApplicationId [the Application (client) ID you copied when creating your app registration]

Install Azure DevOps extensions

The ALM accelerator uses several Azure DevOps extensions, including some third-party extensions that are available in the Azure DevOps marketplace. Under Organization settings in Azure DevOps, install the extensions described in the following procedure. For more information about Azure DevOps extensions from Microsoft and others, go to Evaluate a Marketplace extension publisher. In addition, each of the third-party extension's webpages and the link to their source code are provided in the following list.

  1. Go to https://dev.azure.com, and select Organization settings.

  2. Select General > Extension.

  3. Install the following extensions:

Importing the solution and configuring the app

Install the ALM accelerator in Dataverse

  1. Download the latest managed solution file from GitHub: CenterofExcellenceALMAccelerator_[latest version]_managed.zip.

  2. Go to Power Apps and select the environment you want to use to host the ALM Accelerator for Power Platform app.

  3. On the left pane, select Solutions.

  4. Select Import, and browse to the location of the managed solution you downloaded.

  5. Select Next, and then select Next again.

  6. On the Connections page, select or create a new connection to use to connect to Dataverse for the CDS DevOps connection.

    Note

    When creating a connection for HTTP with Azure AD, use Microsoft Graph for both parameters.

  7. Select Import, and wait for the solution to complete the import process.

Configure the DevOps custom connector

  1. In Power Apps, select your environment, and then select Data > Custom Connectors > CustomAzureDevOps.

  2. Select Edit, go to the Security section, select Edit, and then set the following fields.

    Name Value
    Authentication Type OAuth 2.0
    Identity provider Azure Active Directory
    Client ID The Application (client) ID you copied when creating the app registration
    Client secret The Application (client) Secret you copied when creating the app registration
    Tenant ID Leave as the default, common
    Resource URL The DevOps Application (client) ID you copied when adding permissions to your app registration
  3. Select Update connector.

  4. Verify that the Redirect URL is populated on the Security page with the URL https://global.consent.azure-apim.net/redirect. If the redirect URL is other than https://global.consent.azure-apim.net/redirect, copy the URL and return to the app registration your created and update the redirect URI you set earlier to the updated URL.

  5. After you've completed the preceding steps, verify the connector from the Test menu:

    1. Open the Test menu.

    2. Select New Connection, and then follow the prompts to create a new connection.

    3. In Power Apps, select your environment, and then select Dataverse > Custom Connectors > CustomAzureDevOps.

    4. Select Edit, go to the Test section, and then find the GetOrganizations operation.

    5. Select Test operation, and verify that the Response Status returned is 200 and that the Response Body is json representation of your Azure DevOps organization.

    Test security settings for a custom Azure DevOps connector.

Set up your first Azure DevOps project for use with ALM Accelerator for Power Platform

The ALM Accelerator for Power Platform includes an guided wizard to help you set up your Azure DevOps project to support deployment of Power Platform solutions via ALM Accelerator for Power Platform.

To set up a new project for use with ALM Accelerator for Power Platform, follow these steps:

  1. Open the ALM Accelerator for Power Platform Administration app.
  2. Click Projects in the Azure DevOps group in the left side navigation.
  3. If prompted to update Release Tags, click Okay. The app will download the available release tags from the ALM Accelerator Github repository.
  4. Select an Azure DevOps organization in the Organization drop-down.
  5. In the Projects List, click New and select Project Wizard
  6. In the Project step, enter the name of your project and a description (optional) and click Next. Alternatively you can select to configure an existing empty project.
  7. In the Pipeline Templates step, click Next to install templates into your new project. The app will install the pipeline templates into a new repository in the Project created in the previous step. Alternatively you can configure the Project to use templates from another project that has the templates installed already
  8. In the Service Connections steps, select the environments for which you want to create a Service Connection. You can select multiple environments and create service connections for all of them at the same time. If you want to use different app registrations for your environments you need to create a service connection per app registration. Once you have configure Service Connections for an app registration click Add. When you have configured all the Service Connections you need click Next.
  9. In the Generic Pipelines step, click Next. This will create the required pipelines, variable group and set the required permissions in ADO for the project to support ALM Accelerator for Power Platform functionality.

Set up makers to use the ALM Accelerator for Power Platform app

Read more