Power-Platform-DevOps / Power-Platform-ALM-Starter-Kit

Kit to help you start your DevOps journey with the Power Platform
MIT License
32 stars 2 forks source link
azure-devops power-platform

Power Platform ALM Starter Kit

The goal of this project is to provide to the Power Platform community a kit that will help people start their DevOps journey with the Power Plaform. The content of this repository is mainly for advanced makers with experience with ALM concepts and programming skills. We will try to make this starter kit useful for you.

What does the Power Platform ALM Starter Kit currently covers?

What can you find in the Power Platform ALM Starter Kit?

Power-Platform-ALM-Starter-Kit
│   README.md
│   LICENSE
|   CODE_OF_CONDUCT.md
└───Pipelines
└───└───Templates
│   │   │   create-powerplatform-environment-template.yml: Pipeline template for the creation of a Dataverse environment
│   │   │   create-powerplatform-service-endpoint-template.yml: Pipeline template for the creation of a Power Platform service connection in Azure DevOps
│   │   │   delete-powerplatform-service-endpoint-template.yml: Pipeline template for the deletion of a Power Platform service connection in Azure DevOps
│   │   │   generate-powerplatform-environment-domainname-template.yml: Pipeline template for the generation of a Power Platform environment DomainName based on the EnvironmentName provided
│   │   │   generate-powerplatform-environment-url-template.yml: Pipeline template for the generation of the URL of a Power Platform environment based on the EnvironmentName provided
│   │   │
└───└───Utils
│   │   │   create-powerplatform-environment-and-service-endpoint.yml: Pipeline used to create of a Dataverse environment if it does not exist (search based on the name provided) and generate the associated Power Platform service connection in Azure DevOps
│   │   │   delete-powerplatform-environment-and-service-endpoint.yml: Pipeline used to delete a Dataverse environment and delete the associated Power Platform service connection in Azure DevOps
│   │   │   delete-powerplatform-service-endpoint.yml: Pipeline used to delete a Power Platform service connection in Azure DevOps
│   │   │   powerplatform-service-connection-test.yml: Pipeline used to test a Power Platform service connection with its name provided
│   │   │  
└───Configuration
│   │   powerplatform-spn-template.json: Body request template for the creation of a Power Platform service connection in Azure DevOps
│   │   DataverseEnvironmentConfiguration.txt: Template for the configuration of the Dataverse environment to create
└───Scripts
└───└───Tests
│   │   │   New-DataverseEnvironment.Tests.ps1: Test script of the New-DataverseEnvironment PowerShell function
│   │   New-DataverseEnvironment.ps1: PowerShell function for the creation of a Dataverse environment if it does not exist (search based on the name provided)

How to set-up the Power Platform ALM Starter Kit?

Prerequisites

To use this starter kit, you will need to have the following components already available:

Note: In a multi-tenant scenario, you will need to follow the steps below related to the Azure AD app registration for each considered tenant where you want to manage Dataverse environments.

> Add-PowerAppsAccount
> New-PowerAppManagementApp -ApplicationId 00000000-0000-0000-0000-000000000000

Step-by-step guide

  1. Copy the Pipelines, Configuration and Scripts folders of this repository
  2. Paste it at the root of the repository in the Azure DevOps project you want to use
  3. Update the DataverseEnvironmentConfiguration.txt configuration file in the Configuration folder with the configuration you want for your environments (you can use the content of the Resources section of this page to help you complete this step)
  4. Create pipelines from all YAML pipeline definitions in the Pipelines/Utils folder (Pipelines > New pipeline > Azure Repos Git (YAML) > "NameOfRepositoryWithPipelineDefinitions" > Existing Azure Pipelines YAML File > "BranchWithPipelineDefinitions" > /Pipelines/Utils/...)
  5. Create a variable group in your Azure DevOps project with the following name and with the variables below: power-platform-environment-management-variable-group
    • ApplicationId (secret type variable recommended): Application (client) ID of your app registration in Azure Active Directory
    • AzureDevOpsOrganizationURL: URL of the Azure DevOps organization you are working in (ex: https://dev.azure.com/demonstration/)
    • ClientSecret (⚠ secret type variable strongly recommended): Client secret of your app registration in Azure Active Directory
    • DataverseEnvironmentConfigurationFileName: Full name (with extension) of the file you want to use for the configuration of the Dataverse environments to create (ex: DataverseEnvironmentConfiguration.txt)
    • PatToken (⚠ secret type variable strongly recommended): Value of the PAT (Personal access token) we talked about in the Prerequisites section above
    • PowerPlatformEnvironmentURLBase: Base of the URL (linked to the location) you want to consider for your Dataverse environments to create (ex: crm12.dynamics.com)
    • TenantId (secret type variable recommended): ID of your app registration in Azure Active Directory
  6. Test the pipelines

Resources

You can use the commands below from the Microsoft.PowerApps.Administration.PowerShell PowerShell module to find the information for configuration file for the creation of the Dataverse environments:

For the PowerPlatformEnvironmentURLBase variable in the power-platform-environment-management-variable-group variable group, you can find the available values in the Datacenter regions Microsoft documentation page.

Contributing to the Power Platform ALM Starter Kit project

  1. Fork this repository.
  2. Create a branch: git checkout -b <branch_name>.
  3. Make your changes and commit them: git commit -m '<commit_message>'
  4. Push to the original branch: git push origin <project_name>/<location>
  5. Create a pull request targeting the main branch of this repository

Alternatively see the GitHub documentation on creating a pull request.

Contributors

Thanks to the following people who have contributed to this project:


Benedikt Bergmann

📖

Raphael Pothin

📖

Contact

If needed, you can contact us on twitter:

License

This project is licensed under the MIT license.