Mastering ALM (Application LifeCycle Management) for Microsoft Power Platform: A Comprehensive Guide (Part 6 - digging deeper)

Holger ImberyHolger Imbery
10 min read

This is the sixth part of a series of articles, part 1 (basics and background & part 2 (preparing your environments) & part 3 (working with solutions) & part 4 (working with pipelines & part 5 (approvals with pipelines) were published before.

Having laid a solid foundation by discussing the fundamentals, such as understanding environments, utilizing the Power Platform command-line tool, working with solutions, setting up and using pipelines, and incorporating an approval process before deployment, we are now ready to delve deeper and explore the next logical progression in our journey. The information provided here is an alternative approach designed to assist you in embarking on your path as a Power Platform Application Lifecycle Management (ALM) expert.

We will discuss the Power Platform Center of Excellence (CoE) with its Automation toolkit. The CoE toolkit is a collection of templates, components, and tools designed to help organizations adopt and govern the Power Platform. It provides a structured approach to managing and monitoring Power Platform resources, thereby enhancing the efficiency and effectiveness of ALM processes.

In addition to the CoE toolkit, we will explore the possibility of building Continuous Integration/Continuous Deployment (CI/CD) pipelines using GitHub Actions. GitHub Actions is a powerful automation tool that allows you to create custom workflows for your software development lifecycle processes right from your GitHub repository.

Due to its flexibility and robustness, I prefer using GitHub Actions to manage my deployments. Therefore, I will provide a detailed, step-by-step guide on creating an action to deploy or save a solution to an environment. This guide will cover everything from setting up the action to configuring the workflow and executing the deployment process.

This next phase of our journey will take us beyond the basics and into advanced ALM practices. By understanding and implementing these practices, you will be well on your way to becoming a Power Platform ALM pro.

Power Platform Center of Excellence (CoE)

The Power Platform Center of Excellence (CoE) Starter Kit is a collection of Microsoft templates, components, and tools to help organizations adopt, manage, and govern the Power Platform. The CoE Starter Kit provides tools and analytics to drive platform efficiencies and maintain control over your environment while empowering your teams to create the apps they need.

Here are some examples of what the CoE Starter Kit can do:

  1. Environment Management: It provides a dashboard that gives a comprehensive view of all the environments in your tenant, including details about the type, owner, and number of apps or flows in each environment.

  2. App and Flow Management: It offers tools to manage and monitor apps and flows in your tenant. You can view details about each app or flow, including its owner, creation date, and usage data.

  3. Audit Logs: It allows you to set up audit log flows to track and analyze the usage and performance of your apps and flows.

  4. Governance and Policy Enforcement: It provides tools to enforce policies and ensure compliance. For example, you can set up flows to notify or block specific actions based on your organization's policies.

The Automation components of the CoE Starter Kit are designed to automate some of the everyday tasks related to managing and governing the Power Platform.

Here are some examples of what the Automation components can do:

  1. Automated Clean-up: It can automatically clean up unused apps and flows in your tenant. For example, you can set up a flow to delete apps not used for a certain period.

  2. Automated Notifications: It can send automatic notifications to app owners or makers based on specific triggers. For example, you can set up a flow to notify app owners when their app has not been used for a certain period.

  3. Automated Compliance Checks: It can perform automatic compliance checks. For example, you can set up a flow to check if all apps in your tenant comply with your organization's naming conventions.

In summary, the Power Platform CoE Starter Kit and its automation components provide a robust set of tools to manage, govern, and automate tasks related to the Power Platform, helping organizations drive efficiencies and maintain control over their Power Platform environments.

Please find an overview, the setup instructions, and examples in the documentation.

The ALM Accelerator for the Power Platform

The ALM Accelerator for Power Platform is a solution provided by Microsoft that aims to accelerate the application lifecycle management (ALM) of Power Platform solutions. It leverages Power Platform capabilities and integrates with Azure DevOps to provide a robust, automated, and efficient ALM process.

Here are some examples of what the ALM Accelerator for Power Platform can do:

  1. Solution Management: It provides a structured approach to managing Power Platform solutions. You can create, update, and delete solutions directly from the ALM Accelerator portal.

  2. Environment Management: It allows you to manage your Power Platform environments. You can create, update, and delete environments directly from the ALM Accelerator portal.

  3. Automated Deployment: It integrates with Azure DevOps to provide automated deployment of Power Platform solutions. You can configure deployment pipelines to deploy solutions from one environment to another automatically.

  4. Version Control: It integrates with Azure DevOps to provide version control for Power Platform solutions. You can track changes to your solutions and maintain a history of all versions.

  5. Work Item Management: It integrates with Azure DevOps to provide work item management. You can create, update, and track work items related to your Power Platform solutions.

  6. Automated Testing: It provides tools to automate the testing of your Power Platform solutions. You can create and run automated tests to ensure the quality of your solutions.

In summary, the ALM Accelerator for Power Platform provides a comprehensive set of tools to manage the lifecycle of Power Platform solutions, from creation and development to deployment and maintenance. It helps organizations streamline their ALM processes, improve efficiency, and ensure the quality of their Power Platform solutions.

Please find an overview, the setup instructions, and examples in the documentation.

Application Lifecycle Management (ALM) for developers of Microsoft Power Platform

Application Lifecycle Management (ALM) for developers for Microsoft Power Platform is a set of practices and tools that help developers manage the lifecycle of Power Platform applications. It covers different stages of the application lifecycle, including development, testing, deployment, and maintenance.

Here are some examples of what ALM for developers for Microsoft Power Platform can do:

  1. Source Control Integration: ALM for developers integrates with source control systems like GitHub and Azure DevOps. This allows developers to track changes, collaborate with others, and maintain a history of all versions of their Power Platform applications.

    For example, you can use the Power Platform CLI to export a solution from Power Platform and then commit the solution files to your source control repository:

     pac solution export --path ./MySolution --name MySolution
     git add .
     git commit -m "Exported MySolution"
     git push
    
  2. Automated Deployment: ALM for developers allows you to automate the deployment of Power Platform applications across different environments. This can be done using Power Platform Build Tools in Azure DevOps or GitHub Actions for Power Platform.

    For example, you can use the Power Platform Build Tools to create a pipeline in Azure DevOps that automatically deploys a solution to a target environment whenever a change is pushed to your source control repository.

  3. Testing and Quality Assurance: ALM for developers provides tools for automated testing and quality assurance of Power Platform applications. This includes the Test Studio for creating and running automated tests and the Solution Checker for performing static analysis on solutions.

    For example, you can use the Test Studio to create a test suite for your Power Platform application and then run the test suite as part of your deployment pipeline to ensure the quality of your application.

  4. Monitoring and Analytics: ALM for developers provides tools for monitoring and analyzing the performance and usage of Power Platform applications. This includes the Power Platform Admin Center for monitoring the health and performance of environments and Power BI for analyzing usage data.

    For example, you can use the Power Platform Admin Center to monitor the performance of your Power Platform application and then use Power BI to analyze the usage data and gain insights into how your application is being used.

In summary, ALM for developers of Microsoft Power Platform provides a comprehensive set of practices and tools for managing the lifecycle of Power Platform applications. It helps developers to streamline their development processes, improve efficiency, and ensure the quality of their applications.

Please find an overview, the setup instructions, and examples in the documentation.

GitHub Actions allows developers to construct automated software development lifecycle workflows. Utilizing GitHub Actions for Microsoft Power Platform, developers can establish workflows within their repositories to build, test, package, release, and deploy applications, execute automation, and manage bots and additional components developed on Microsoft Power Platform.

GitHub Actions for Microsoft Power Platform include the following capabilities:

  • Importing and exporting application metadata (also known as solutions) containing various platform components such as canvas apps, model-driven apps, desktop flows, Power Virtual Agents chatbots, AI Builder models, customer engagement apps (Dynamics 365 Sales, Dynamics 365 Customer Service, Dynamics 365 Field Service, Dynamics 365 Marketing, and Dynamics 365 Project Service Automation), and connectors between development environments and source control.

  • Deploying to downstream environments.

  • Provisioning or de-provisioning environments.

  • Conducting static analysis checks on solutions using the Power Apps Solution Checker.

You can use GitHub Actions for Microsoft Power Platform and other available GitHub Actions to create your build and release workflows. Common workflows implemented by teams involve setting up development environments, exporting from a development environment to source control, generating builds, and deploying applications.

How to Begin

You can utilize GitHub Actions for Microsoft Power Platform by incorporating the actions into your workflow definition file (.yml). Example workflow definitions can be found in the GitHub Actions lab.

Connection to environments

To interact with a Dataverse environment, you must create a secret allowing the various GitHub Actions to perform the necessary tasks.
Therefore, you need to work with the following:
Service principal and client secret: This connection type utilizes service principal-based authentication and supports multi-factor authentication. Service principal authentication
You can follow the steps here and work with easy-to-understand command line commands, for example:

get Tenant ID/ApplicationID/Secret

pac admin create-service-principal --environment d3fcc479-0122-e7af-9965-bde57f69ee1d
Connected as admin@M365x57236726.onmicrosoft.com
Successfully assigned user adde6d52-9582-4932-a43a-beca5d182301 to environment d3fcc479-0122-e7af-9965-bde57f69eeld with security role System Administrator
Tenant ID                            Application ID                       Client Secret                           Expiration
2b0463ed-efd7-419d-927d-a9dca49d899c adde6d52-9582-4932-a43a-beca5d182301 beY8Q~JBZ~CBDgIKKBjbZ3g6BofKzoZkYj23Hbf 7/31/2024 4:27:03 PM

and assign it to your environment

pac admin assign-user --user "adde6d52-9582-4932-a43a-beca5d182301" --role "System administrator" --environment d3fcc479-0122-e7af-9965-bde57f69ee1d --application-user
Connected to... SnDemoDev
Connected as admin@M365x57236726.onmicrosoft.com
Successfully assigned user adde6d52-9582-4932-a43a-beca5d182301 to environment d3fcc479-0122-e7af-9965-bde57f69ee1d with security role System Administrator

Available Actions

There are actions to:
Microsoft Power Platform development and
Microsoft Power Platform administration

Examples

Remember: Many actions necessitate connecting to a Microsoft Dataverse environment. You can include service principal in your GitHub repository and utilize them in the workflow.

For information on setting up secrets in GitHub, visit Using encrypted secrets in a Workflow.

Once correctly configured, you can invoke the service principal within your action scripts.

In your GitHub Actions script, define the following parameters as environment variables:

  • Application ID: APPLICATION_ID:<your application id>

  • Tenant ID: TENANT_ID:<your tenant id>

The client secret will be stored as a GitHub secret and referenced from within the action script using a parameter like a client secret: ${{secrets.APPLICATION_ID}}.

Example export and branch a solution:

name: export-and-branch-solution
# Export solution from DEV environment
# unpack it and prepare, commit and push a git branch with the changes

on:
  workflow_dispatch:
    inputs:
      # Change this value
      solution_name:
        description: 'name of the solution to worked on from Power Platform'
        required: true
        default: SolutionName
       #Do Not change these values
      solution_exported_folder:
        description: 'folder name for staging the exported solution *do not change*'
        required: true
        default: out/exported/
      solution_folder:
        description: 'staging the unpacked solution folder before check-in *do not change*'
        required: true
        default: out/solutions/
      solution_target_folder: 
       description: 'folder name to be created and checked in *do not change*'
       required: true
       default: solutions/

jobs:
  export-from-dev:
    runs-on: windows-latest
    # or you can say runs-on: ubuntu-latest
    env:
      RUNNER_DEBUG: 1

    steps:
    - uses: actions/checkout@v2
      with:
        lfs: true

    - name: who-am-i action
      uses: microsoft/powerplatform-actions/who-am-i@v0
      with:
        environment-url: ${{secrets.ENVIRONMENTURL}}
        app-id: ${{secrets.CLIENTID}}
        client-secret: ${{secrets.SPN }}
        tenant-id: ${{secrets.TENANTID}}


    - name: export-solution action
      uses: microsoft/powerplatform-actions/export-solution@v0
      with:
        environment-url: ${{secrets.ENVIRONMENTURL}}
        app-id: ${{secrets.CLIENTID}}
        client-secret: ${{ secrets.SPN }}
        tenant-id: ${{secrets.TENANTID}}
        solution-name: ${{ github.event.inputs.solution_name }}
        solution-output-file: ${{ github.event.inputs.solution_exported_folder}}/${{ github.event.inputs.solution_name }}.zip

    - name: unpack-solution action
      uses: microsoft/powerplatform-actions/unpack-solution@v0
      with:
        solution-file: ${{ github.event.inputs.solution_exported_folder}}/${{ github.event.inputs.solution_name }}.zip
        solution-folder: ${{ github.event.inputs.solution_folder}}/${{ github.event.inputs.solution_name }}
        solution-type: 'Unmanaged'
        overwrite-files: true

    - name: branch-solution, prepare it for a PullRequest
      uses: microsoft/powerplatform-actions/branch-solution@v0
      with:
        solution-folder: ${{ github.event.inputs.solution_folder}}/${{ github.event.inputs.solution_name }}
        solution-target-folder: ${{ github.event.inputs.solution_target_folder}}/${{ github.event.inputs.solution_name }}
        repo-token: ${{ secrets.GITHUB_TOKEN }}
        allow-empty-commit: true

Conclusion

Mastering Application Lifecycle Management (ALM) for Microsoft Power Platform is essential for organizations looking to streamline their development processes, improve efficiency, and maintain control over their environments. By leveraging the Power Platform Center of Excellence (CoE) Starter Kit, the ALM Accelerator for Power Platform, and utilizing GitHub Actions for ALM, developers can effectively manage and automate tasks related to the Power Platform, ensuring the quality and success of their applications.

0
Subscribe to my newsletter

Read articles from Holger Imbery directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Holger Imbery
Holger Imbery

I talk and write about conversational AI, robotic process automation, and things that keep an architect awake at night. Your feedback on my articles is highly appreciated, and I would like to invite you to a professional discussion. I'm a Principal Architect @NTTDATA focusing on Microsoft Power Platform and Azure.