CI/CD for Power Platform using GitHub Actions
Published Jun 14 2022 09:50 AM 2,385 Views
Microsoft

mjschanne_1-1655225280263.png

 

CI/CD for Power Platform using GitHub Actions

Let’s discuss using GitHub actions to provide continuous integration and deployment capabilities for Power Platform solutions. This article will expand on why and several considerations to keep in mind but you can find the how in this tutorial which this post will reference.

 

Prerequisites

  • Power Platform Solution that has a Dataverse database
  • GitHub Repository
  • App registration privileges in Azure
  • Power Platform admin privileges for your environment

 

Why

At Microsoft Build, several pro-dev capabilities for Power Platform were demonstrated and other citizen developer features were announced. Really what was highlighted though was how Power Platform can be a place of collaboration between citizen developers and pro devs. To really empower that kind of collaboration though, you need to have a robust CI/CD process in place to let changes coming from every which way of development come together seamlessly in source control. Also at Build was the Microsoft Power Platform Landing Zones where how to architect for Power Platform including CI/CD was showcased. In the diagrams, Azure DevOps is shown as the host for source control but you can use GitHub just as effectively.

 

Configuring Permissions through App Registration and App User

While following the linked tutorial, you set up an app registration in Azure and link it to an application user in your environment in Power Platform.

 

When you are creating the app registration, you only need to the API permission user_impersonation for Dynamics CRM though the tutorial has you add some additional permissions. Your app then uses the application user associated with that app registration to impersonate when you sign-in using the client credentials for that app. The permissions for what your app can do are derived from the security roles that you assign to the application user in the Power Platform admin center. It is worth noting that your application user is restricted to your environment so if you intend to use multiple environments then you will need to and users.

 

GitHub Actions

The template workflows that the tutorial has you copy leverage actions for Power Platform. If you are new to GitHub actions, it is important to know that GitHub actions are hosted in GitHub and you can make your own. So if you find that the actions here don’t cover the full range of what you need, you can create your own actions using the same stuff under the hood of the official Power Platform actions – the Power Platform CLI. The CLI has a variety of commands for managing solutions and environments in Power Platform and Dataverse but most importantly it allows you to use client credentials to avoid a device login flow thereby enabling its use in CI/CD processes.

 

Summary

In short, Power Platform is intended to provide a collaborative environment between citizen developers and pro devs. The best way to enable this vision is through solid CI/CD capabilities. You can write your own CI/CD flow using the Power Platform CLI and GitHub actions or combine the existing released actions as necessary to create the workflow that works for your team’s development style.

 

 

 

Co-Authors
Version history
Last update:
‎Jun 14 2022 09:50 AM
Updated by: