Automate Solution Deployments Using Power Platform Pipelines
Set up a managed pipeline to move solutions from development to test to production with built-in consistency and security.
Power Platform Pipelines are a built-in ALM feature that allows you to define a repeatable deployment path for your solutions. Instead of relying on manual exports and imports, a pipeline automates the movement of a managed solution from a development environment through successive stages—typically test and production—while preserving deployment settings like environment variables and connection references.
In this tutorial, you will create a pipeline for a fictional inventory application named Contoso Inventory. You will link a development environment, add a test stage, and then a production stage that depends on the test stage, enforcing an orderly progression.
Prerequisites
Before you begin, ensure your tenant has the following:
- A host environment with the Power Platform Pipelines package installed. This environment acts as the control plane for pipeline configuration.
- At least three environments: development (ContosoDev), test (ContosoTest), and production (ContosoProd).
- The Deployment Pipeline Configuration model-driven app available in the host environment.
- Appropriate licenses for the users who will create and deploy pipelines.
If the pipeline components are not yet installed in your host environment, follow the official Microsoft Learn guide to enable the feature before proceeding.
Step 1: Create the Pipeline
- Sign in to the host environment and open the Deployment Pipeline Configuration app.
- In the left navigation, select Pipelines and click New Pipeline.
- Enter a meaningful name, for example
Contoso Inventory CI/CD Pipeline. - Enable the option Allow redeployments of older versions to permit re‑deploying any previously deployed solution version.
- Save the pipeline record.
After saving, the pipeline appears in the list and you can start linking environments and configuring stages.
Step 2: Link a Development Environment
The pipeline needs to know which environment is the source for solution exports.
- In the pipeline record, locate the Linked Development Environments subgrid.
- Click Add Existing and select the development environment record (ContosoDev). If the record does not exist, create one by navigating to the Environments page in the same app.
- Save.
The development environment now appears in the subgrid. Multiple development environments can be linked if your team works in parallel.
Step 3: Add a Test Deployment Stage
The first target stage is typically a quality assurance or test environment.
- In the same pipeline record, scroll to the Deployment Stages subgrid and click New Deployment Stage.
- Configure the stage as follows:
- Name –
Deploy to Test - Owner – your user account (or a service account)
- Deployment Pipeline – the pipeline you created (auto‑filled)
- Target Deployment Environment ID – select ContosoTest (the record representing your test environment)
- Name –
- Leave Previous Deployment Stage blank because this is the first stage.
- Save and close.
The test stage now appears in the subgrid.
Step 4: Add a Production Deployment Stage
The production stage should occur only after a successful deployment to the test stage. Power Platform Pipelines enforce this dependency by setting the previous stage.
- Click New Deployment Stage again.
- Configure as follows:
- Name –
Deploy to Production - Owner – your user account
- Deployment Pipeline – auto‑filled
- Previous Deployment Stage – select Deploy to Test
- Target Deployment Environment ID – select ContosoProd
- Name –
- Save and close.
Always set the Previous Deployment Stage on the production stage. Without this, the pipeline will not enforce sequential deployments and operators could accidentally deploy to production before testing.
Now the pipeline contains two stages in sequence. The Deploy to Test stage must be executed before Deploy to Production is allowed.
Step 5: Deploy a Solution Through the Pipeline
Once the pipeline is configured, deployment is initiated by solution makers or admins.
- Navigate to the default solution in the development environment (or any unmanaged solution).
- Select the solution and click Pipeline on the command bar.
- Choose a previous deployment (if redeploying) or a new version.
- Select the target stage (e.g., Deploy to Test) and proceed.
The pipeline will export a managed solution from the development environment, apply the deployment settings, and import it into the target environment.
Deployment Settings (Configuration)
One of the most useful features of pipelines is the ability to override connection references and environment variables at deployment time. These settings are stored as JSON and can be applied automatically when a solution is deployed to a target environment.
Example deployment settings for a SQL connection and a base URL:
{
"ConnectionReferences": [
{
"LogicalName": "new_contoso_sql_connection",
"ConnectionId": "contoso-sql-connection-id",
"ConnectorId": "/providers/Microsoft.PowerApps/apis/shared_sql"
}
],
"EnvironmentVariables": [
{
"SchemaName": "new_contoso_BaseUrl",
"Value": "https://api.contoso.com"
}
]
}These settings can be attached to each deployment stage so that the correct values are injected into the target environment.
Common Mistakes & Troubleshooting
- Missing environment records: Ensure that environment records exist in the Environments page of the Deployment Pipeline Configuration app before linking them to a pipeline.
- Incorrect environment ID: When selecting the target environment, make sure the lookup uses the environment record created during setup, not the environment’s display name. The record contains the environment ID.
- Forgetting to allow redeployments: If you need to re‑deploy older versions, enable the option during pipeline creation. It cannot be changed later on an existing pipeline.
- Dependency cycles: The Previous Deployment Stage is required for a linear workflow. If you mistakenly set a cycle, the pipeline will not function.
- Solution visibility: Managed solutions deployed via pipelines are not editable in the target environment. Always use an unmanaged source solution in development.
Final Recommendation
Start with a simple two‑stage pipeline (dev → test) to validate your setup. Gradually add a production stage and introduce deployment settings. Test the entire flow with a non‑critical solution first, and involve your security team to assign the appropriate pipeline roles (Pipeline User and Pipeline Deployer) to your makers and operators.
References
- Original article: Create A Power Platform Pipeline by Matthew Devaney.
- Microsoft Learn: Set up Power Platform Pipelines (placeholder – verify official URL).
- Microsoft Learn: Deploy solutions using Power Platform Pipelines (placeholder – verify official URL).