Skip to main content
The Deploy Power Platform action deploys Power Platform solutions to target environments. It supports deploying from both built artifacts and unpacked solution folders, with authentication via username/password or application ID.

Usage

- uses: microsoft/AL-Go/Actions/[email protected]
  with:
    environmentName: 'Production'
    artifactsFolder: '.artifacts'
    deploymentEnvironmentsJson: ${{ needs.determine.outputs.DeploymentEnvironmentsJson }}

Inputs

shell
string
default:"powershell"
Shell in which you want to run the action (powershell or pwsh)
environmentName
string
required
Name of environment to deploy toThis should match the environment name configured in your deployment settings.
artifactsFolder
string
default:""
Path to the downloaded artifacts to deploy (when deploying from a build)Should contain the built Power Platform solution .zip file.
solutionFolder
string
default:""
Path to the unpacked solution to deploy (when deploying from branch)Used for deploying directly from source without a build step.
deploymentEnvironmentsJson
string
required
The settings for all Deployment Environments in compressed JSON formatContains authentication credentials and environment URLs for Power Platform deployments.

Example Workflows

Deploy from Build Artifacts

jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Download artifacts
        uses: actions/download-artifact@v4
        with:
          name: power-platform-solution
          path: .artifacts
      
      - name: Deploy Power Platform Solution
        uses: microsoft/AL-Go/Actions/[email protected]
        with:
          environmentName: 'Production'
          artifactsFolder: '.artifacts'
          deploymentEnvironmentsJson: ${{ secrets.DEPLOYMENT_ENVIRONMENTS }}

Deploy from Source

- name: Deploy Power Platform Solution from Source
  uses: microsoft/AL-Go/Actions/[email protected]
  with:
    environmentName: 'Development'
    solutionFolder: 'src/PowerPlatformSolution'
    deploymentEnvironmentsJson: ${{ secrets.DEPLOYMENT_ENVIRONMENTS }}

Complete Build and Deploy Workflow

jobs:
  determine:
    runs-on: ubuntu-latest
    outputs:
      deploymentEnvironmentsJson: ${{ steps.determine.outputs.DeploymentEnvironmentsJson }}
      environmentsMatrixJson: ${{ steps.determine.outputs.EnvironmentsMatrixJson }}
    steps:
      - uses: actions/checkout@v4
      
      - name: Determine Deployment Environments
        id: determine
        uses: microsoft/AL-Go/Actions/[email protected]
        with:
          getEnvironments: '*'
          type: 'CD'
  
  build:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      
      - name: Build Solution
        uses: microsoft/AL-Go/Actions/[email protected]
        with:
          solutionFolder: 'src/MySolution'
          outputFolder: '.artifacts'
          outputFileName: 'MySolution'
      
      - name: Upload artifacts
        uses: actions/upload-artifact@v4
        with:
          name: power-platform-solution
          path: .artifacts
  
  deploy:
    needs: [determine, build]
    runs-on: ubuntu-latest
    strategy:
      matrix: ${{ fromJson(needs.determine.outputs.environmentsMatrixJson) }}
    steps:
      - uses: actions/checkout@v4
      
      - name: Download artifacts
        uses: actions/download-artifact@v4
        with:
          name: power-platform-solution
          path: .artifacts
      
      - name: Deploy to ${{ matrix.environment }}
        uses: microsoft/AL-Go/Actions/[email protected]
        with:
          environmentName: ${{ matrix.environment }}
          artifactsFolder: '.artifacts'
          deploymentEnvironmentsJson: ${{ needs.determine.outputs.deploymentEnvironmentsJson }}

Authentication

The action supports two authentication methods:

Username/Password Authentication

Configure your deploymentEnvironmentsJson with:
{
  "Production": {
    "ppUserName": "[email protected]",
    "ppPassword": "***",
    "ppEnvironmentUrl": "https://org.crm.dynamics.com"
  }
}

Application ID Authentication

Configure your deploymentEnvironmentsJson with:
{
  "Production": {
    "ppTenantId": "tenant-guid",
    "ppApplicationId": "app-guid",
    "ppClientSecret": "***",
    "ppEnvironmentUrl": "https://org.crm.dynamics.com"
  }
}
The action automatically rebuilds the solution before deployment to inject Business Central environment details if configured.
Store Power Platform credentials securely using GitHub secrets. Never commit credentials to your repository.

Build docs developers (and LLMs) love