Skip to content

dylanhaskins/Microsoft.PowerPlatform.DevOps.Documentation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

What is Microsoft.PowerPlatform.DevOps?

The Microsoft.PowerPlatform.DevOps toolset and framework is built around environment and solution management implementation strategies documented in the ALM White Paper for Power Platform.

Our framework includes a rich toolset that allow developers and non-developers alike to:

  • Create and manage environments
  • Create and manage Solutions
  • Bind and manage environments and solutions to source control
  • Implement a structured build and release strategy across all environments for all solutions
  • Leverage built in code standards
  • Speed up delivery of projects
  • Scale and easy adoption
  • Build on top of the standard ALM and Platform SDK tooling
  • Implement standard toolset on projects, including large, multi team, and multi environment projects
  • Standardise delivery and architectural design across projects

Setup the module

Action PowerShell Cmdlet Steps
Installing the module Install-Module -Name Microsoft.PowerPlatform.DevOps 1. Run 'Windows PowerShell' as an administrator
2. Run the cmdlet
Note: Other installation methods can be found at https://www.powershellgallery.com/packages/Microsoft.PowerPlatform.DevOps
Using the module Invoke-PowerPlatformDevOps 1. Run the cmdlet
Note: It is recommended that you open PowerShell as administrator
Find what version you have installed Get-InstalledModule Microsoft.PowerPlatform.DevOps 1. Run the cmdlet
Note: Your current running version is also specified on the top of the screen when you invoke the module
Find newer version [U] 1. Invoke-PowerPlatformDevOps
2. Select [U] to check if there are newer versions available
Update your version Update-Module Microsoft.PowerPlatform.DevOps -Force 1. Run the cmdlet

Pre-requisites:

Terminology

Term Description
ADO Azure DevOps
CDS Common Data Service

Videos

For a detailed instruction on the toolset, link via 365.training

Quick guide to using the tool

# Step Description
1 Run Pre-requisite checks (Install / Update) This step installs the relevant dependencies required by the tool (e.g. git, node.js, etc. )
2 Create a New Project or Select Existing To set up and connect the project for use in the tool
3 Configure Azure DevOps (ADO Org: sampleOrg | ADO Project: SampleADOProject | git Repo: sampleRepo ) Create or connect to an ADO Project
4 Add New D365 / CDS Solution Add a solution from a CDS environment to your local repository
5 Configure Continuous Deployment (CI/CD Environment : Staging01 | CI/CD URL : https://example.crm6.dynamics.com) Add staging environment
A Enable [A]zure Resource Management Deployment
F Add Azure [F]unction App Project
D Add Additional [D]365 / CDS Solutions
E [E]xport & Unpack Solution to Source Control
S Commit and [S]ync changes to Source Control
V [V]iew current change log for Source Control
T Add Additional Deployment Environment [T]arget
U Check for [U]pdates to Microsoft.PowerPlatform.DevOps
Q Press 'Q' to quit

Create a New Project or Select Existing

Option Description
Select an existing project Connect to a local project repository you have previously connected to using the tool
Browse for local repository Connect to a local project repository by browsing your file directory
Create a new project Create and connect a new local project repository
Clone an existing repo Clone an existing repository from ADO

Configure Azure DevOps

  • Connects to your ADO organisation and project
  • Connects your local repository to ADO

Outcomes:

  • Local repository is set up to be connected to ADO, configurations are retained in <YourADORepo>.json file

    {
        "ID":  "",
        "Name":  "",
        "ProjectLocation":  "",
        "ADOProject":  "SampleADOProject",
        "gitRepo":  "SampleRepo",
        "ADOOrgName":  "SampleOrg",
        "ADOConfigured":  "True",
        "SolutionAdded":  "False",
        "CICDEnvironmentName":  "False",
        "CICDEnvironmentURL":  "",
        "CICDVarGroupID":  "",
        "CIPipeLineId":  "",
        "ARMAdded":  "Optional",
        "FunctionAppAdded":  "Optional",
        "ServicePrincipal":  "Optional",
        "CDSSolutions": [
    
                        ],
        "selectedSubscription":  "00000000-0000-0000-0000-000000000000",
        "selectedSubscriptionName":  "Sample Subscription",
        "AzureKeyVaultName":  "",
        "ClientID":  "",
        "ClientSecretAKVName":  "",
        "TenantID":  "",
        "EnvironmentSecurityID":  ""
    }

Add New D365 / CDS Solution

  • Add a solution from a CDS environment to your local repository

Outcomes:

  • Commit in git history for adding solution and related solution files

    • Including an update in deployPackages.json with reference to your new solution

      [
          { 
              "DestinationFolder": "SolutionOne",
              "PackageFolder": "SolutionOne",
              "PackageName": "SolutionOnePackage.dll",
              "SolutionName": "SolutionOne",
              "DeployTo": [
                  {
                      "EnvironmentName": "Deployment Staging",
                      "DeploymentType": "Managed",
                      "DeployData": "true",
                      "PreAction": "false",
                      "PostAction": "false"
                  }
              ],
              "DeploymentSteps": "",
          }
      ]
  • <YourADORepo>.json file updated with solution reference

    {
        "ID":  "",
        "Name":  "",
        "ProjectLocation":  "",
        "ADOProject":  "SampleADOProject",
        "gitRepo":  "SampleRepo",
        "ADOOrgName":  "SampleOrg",
        "ADOConfigured":  "True",
        "SolutionAdded":  "True",
        "CICDEnvironmentName":  "False",
        "CICDEnvironmentURL":  "",
        "CICDVarGroupID":  "",
        "CIPipeLineId":  "",
        "ARMAdded":  "Optional",
        "FunctionAppAdded":  "Optional",
        "ServicePrincipal":  "Optional",
        "CDSSolutions": [
                            {
                                "SolutionName":  "SolutionOne",
                                "ID":  0
                            }
                        ],
        "selectedSubscription":  "00000000-0000-0000-0000-000000000000",
        "selectedSubscriptionName":  "Sample Subscription",
        "AzureKeyVaultName":  "",
        "ClientID":  "",
        "ClientSecretAKVName":  "",
        "TenantID":  "",
        "EnvironmentSecurityID":  ""
    }

Configure Continuous Deployment

Outcomes:

  • <YourADORepo>.json file updated with staging environment details

        {
            "ID":  "",
            "Name":  "",
            "ProjectLocation":  "",
            "ADOProject":  "SampleADOProject",
            "gitRepo":  "SampleRepo",
            "ADOOrgName":  "SampleOrg",
            "ADOConfigured":  "True",
            "SolutionAdded":  "True",
            "CICDEnvironmentName":  "Staging",
            "CICDEnvironmentURL":  "https://staging.crm6.dynamics.com",
            "CICDVarGroupID":  "1",
            "CIPipeLineId":  "1",
            "ARMAdded":  "Optional",
            "FunctionAppAdded":  "Optional",
            "ServicePrincipal":  "Optional",
            "CDSSolutions": [
                                {
                                    "SolutionName":  "SolutionOne",
                                    "ID":  0
                                }
                            ],
            "selectedSubscription":  "00000000-0000-0000-0000-000000000000",
            "selectedSubscriptionName":  "Sample Subscription",
            "AzureKeyVaultName":  "",
            "ClientID":  "",
            "ClientSecretAKVName":  "",
            "TenantID":  "",
            "EnvironmentSecurityID":  ""
        }
  • New 'Staging' environment in ADO

  • New variable group in ADO

Add Additional Deployment Environment [T]arget

  • Connects additional target environment
  • Adds pipeline environment
  • Adds credentials as variables in pipeline library
  • Note: Further configuration is required in deployPackages.json to define environments to deploy a solution to

Outcomes:

  • build.yaml file appended with new environment

    - stage: Test
        
        displayName: Test
        dependsOn: 'Deployment_Staging'
        condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/master'),notIn(variables['Build.Reason'], 'IndividualCI', 'PullRequest'))
        jobs:
        - deployment: DeployJob      
        displayName: Test 
        environment: 'Test'
        variables:
        - group: SampleRepo.D365TestEnvironment
        strategy:
        runOnce:
            deploy:
            steps:
            - task: PowerShell@2
                displayName: 'Deploy Solution'
                inputs:
                targetType: filePath
                filePath: '$(Pipeline.Workspace)/drop/Solutions/Scripts/SolutionDeploy.ps1'
                arguments: '-DeployServerUrl $(d365url) -UserName $(d365username) -Password $(d365password) -PipelinePath $(Pipeline.Workspace)'
  • New 'Test' environment in ADO

  • New variable group in ADO

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published