Power Platform Azure DevOps YAML, Read in Stage Order: Dev to Prod
Learn publishes no single Power Platform Azure DevOps YAML file. Read its pages in stage order and you get one dev, build, test, prod pipeline, cited.
If you search for Power Platform Azure DevOps YAML on Microsoft Learn, you find fragments. The Build Tools tasks page ends with a build pipeline and a release pipeline, but the task lists under those headings are images, not text you can copy. The GitHub deployment tutorial describes its workflows and then links the YAML from a GitHub repository instead of printing it on Learn.
Our view: the pipeline is already in Microsoft’s documentation, split up by product team, roughly one stage per page. Read those pages in stage order and they form a Power Platform dev test prod pipeline with a documented Microsoft control at every stage. This piece puts the pages back in order and attributes every step. Any combined YAML below is labeled “Our view: illustrative, not a Learn sample”, because Learn publishes no such file.
The Power Platform dev test prod pipeline on one page
Microsoft documents two routes to production. They share stages, but they are different products, so treat them as two separate lanes.
- Route A: Pipelines in Power Platform handle the deployment, extended with GitHub Actions or Azure DevOps when needed.
- Route B: Build Tools for Azure DevOps or GitHub Actions handle export, build and import.
Route A does not build from Git. According to Overview of pipelines in Power Platform, “Both managed and unmanaged solutions are automatically exported and stored in the pipelines host for every deployment.” Extend pipelines in Power Platform adds that once the artifacts are exported, the system “prohibits any tampering or modification.” The artifact comes from the development environment at the moment a maker submits a deployment, not from a branch. The same overview page says Microsoft encourages customers “to use pipelines for core deployment functionality, and when needed, extend pipelines to integrate with other CI/CD tools.”
| Stage | Control (Route A or B) | Learn page |
|---|---|---|
| Dev | Route A: unmanaged solution in a developer environment, optional Git integration | Solution concepts; Overview of Git integration in Power Platform |
| Dev | Route B: export unmanaged, unpack into source control | Microsoft Power Platform Build Tools tasks |
| Build | Route A: managed and unmanaged copies exported on submit and stored in the host | Overview of pipelines in Power Platform |
| Build | Route B: set version, pack managed, run the Checker | Microsoft Power Platform Build Tools tasks |
| Test | Route A: sequential stages, preflight checks, optional pre-deployment step | Run pipelines in Power Platform; Extend pipelines in Power Platform |
| Test | Route B: import the same managed artifact into a separate test environment | Solution concepts; Environment strategy for ALM |
| Prod | Route A: delegated deployment as a service principal with an approval flow | Deploy pipelines as a service principal or pipeline owner |
| Prod | Route B: import with a deployment settings file | Pre-populate connection references and environment variables |
Route A is the route Microsoft recommends for deployment. Route B is how you get a build that comes from source control. Our view: choose one per solution and name it in your architecture review, so nobody draws a diagram that implies Pipelines read a Git branch.
Dev: unmanaged, source-controlled, and the only place Git integration belongs
The development stage has two rules, and both are on Solution concepts: “Unmanaged solutions are used in development environments while you make changes to your application.” and “Exported unmanaged versions of your solutions should be checked into your source control system.” The ALM overview adds the principle behind them: “Source control should be your source of truth for storing and collaborating on your components.”
Dataverse Git integration is the in-product way to connect development to a repository, and Learn limits where it goes. Overview of Git integration in Power Platform says: “Use Git integration with developer environments, not in your test or production environments.”
The Git integration FAQs list the limits that matter for design:
- “Development and target environments must be enabled as managed environments.”
- “This feature works with a single branch that you specify when you bind the environment or solutions to your repository.”
- On cross-tenant workloads, the answer is “Not currently.”
The GitHub connection is preview. Connect to GitHub (preview) carries the notice that “Preview features aren’t meant for production use and may have restricted functionality.” Azure DevOps repositories are also supported.
Two rules come from two features, and they are easy to mix up. Pipelines in Power Platform say “Developer environments aren’t required to be managed environments.” Git integration requires a managed development environment. Both statements are true because they describe different features.
Microsoft’s ALM documentation also recommends a minimum environment count. Environment strategy for ALM recommends that “you also maintain at least one test environment that’s separate from your development and production environments.”
Takeaway: if you want Git in development, make that environment a managed environment now. Learn requires managed environments for Git integration, even though Pipelines would accept an unmanaged developer environment.
Build: the Power Platform Azure DevOps YAML Learn actually publishes
The build artifact is a managed solution. Solution concepts says: “As an ALM best practice, managed solutions should be generated by exporting an unmanaged solution as managed and considered a build artifact.” The Git FAQs give the other path: you can build “the solution from source control with the Power Platform CLI pack command.”
The Power Platform Azure DevOps YAML that Learn publishes is a set of single task lines on Microsoft Power Platform Build Tools tasks, one per task section. Learn does not put them in order. Our view of the order, with versioning placed before export and pack:
- Tool Installer, which the page says to add once before any other Build Tools task
- WhoAmI, which the page suggests early in a pipeline to verify connectivity
- Set Solution Version
- Export Solution
- Unpack Solution, where the page marks Unmanaged as recommended
- Pack Solution, where the page marks Managed as recommended
- Checker, run on the solution file
The page describes the Checker as a static analysis check “against a set of best-practice rules to identify any problematic patterns”. Its parameters include RuleSet, ErrorLevel and ErrorThreshold, and a FailOnPowerAppsCheckerAnalysisError parameter also exists. ErrorThreshold “Defines the number of errors (>=0) of a specified level that are allowed for the checker to pass the solutions being checked.”
Three details on the page are easy to miss.
- The FileLocation note says: “Reference an exported solution file and not the unpacked source files in your repository.” Point the Checker at a solution zip file, never at the unpacked folder.
- Build Tools for Azure DevOps says “The output of the Checker task is a SARIF file.”
- Microsoft’s sample RuleSet is a GUID, and the page does not say which rule set it names. The documented option you want is the Solution checker rule set: “This rule set is the same one that runs from the Power Apps maker portal.”
The Build Tools page also sets limits you should write into your pipeline standard:
- You cannot mix Build Tools 1.0 and 2.0 tasks in one pipeline. Version 2.0 is the version Microsoft maintains and adds features to.
- Service Principal via Workload Identity Federation is the recommended connection type, and the page calls it the choice for tenants that require multi-factor authentication.
- The username and password connection does not support users who require multi-factor authentication.
pac admin create-service-principaladds the application “as an administrator user to the Microsoft Power Platform tenant,” and its role parameter defaults to System Administrator. Treat that as a starting point and not as least privilege.
The stitched file below shows the shape of Power Platform Azure DevOps YAML read in stage order. Every value Learn does not quote is left as an empty comment, and you cannot run it as is.
# Our view: illustrative, not a Learn sample.
# Learn publishes no end-to-end file. Task lines and the RuleSet line are quoted
# from Microsoft's samples. Order and comments are ours. Other inputs are omitted.
# Tool Installer: add once, before any other Build Tools task
# Source: Microsoft Power Platform Build Tools tasks
- task: microsoft-IsvExpTools.PowerPlatform-BuildTools.tool-installer.PowerPlatformToolInstaller@2
# WhoAmI: early, to verify connectivity
# Source: Microsoft Power Platform Build Tools tasks
# service connection:
# Workload Identity Federation is the recommended type
# Source: Microsoft Power Platform Build Tools for Azure DevOps
- task: microsoft-IsvExpTools.PowerPlatform-BuildTools.whoami.PowerPlatformWhoAmi@2
# Set Solution Version: version before export and pack
# Source: Microsoft Power Platform Build Tools tasks
- task: microsoft-IsvExpTools.PowerPlatform-BuildTools.set-solution-version.PowerPlatformSetSolutionVersion@2
# Export Solution
# Source: Microsoft Power Platform Build Tools tasks
# Managed:
- task: microsoft-IsvExpTools.PowerPlatform-BuildTools.export-solution.PowerPlatformExportSolution@2
# Unpack Solution: the page lists Unmanaged as recommended
# Source: Microsoft Power Platform Build Tools tasks
# SolutionType:
- task: microsoft-IsvExpTools.PowerPlatform-BuildTools.unpack-solution.PowerPlatformUnpackSolution@2
# Pack Solution: the page lists Managed as recommended
# Source: Microsoft Power Platform Build Tools tasks
# SolutionType:
- task: microsoft-IsvExpTools.PowerPlatform-BuildTools.pack-solution.PowerPlatformPackSolution@2
# Checker: point at a solution zip, not unpacked source. Output is SARIF.
# Source: Microsoft Power Platform Build Tools tasks
- task: microsoft-IsvExpTools.PowerPlatform-BuildTools.checker.PowerPlatformChecker@2
inputs:
RuleSet: '0ad12346-e108-40b8-a956-9a8f95ea18c9'
# ErrorLevel:
# ErrorThreshold:
Microsoft’s own export sample sets Managed to true. Set the value to match your design instead of copying it, and use the same discipline for every commented value above.
Takeaway. Our view: run the Checker on the exported zip and fail the build on ErrorThreshold. That way static analysis gates the artifact instead of producing a report nobody reads.
The Power Platform GitHub Actions workflow equivalent
The same stages exist as GitHub Actions. Available GitHub Actions for Microsoft Power Platform development lists install, whoAmI, export, unpack, pack, check, import and deploy-package actions, among others. Our view: a Power Platform GitHub Actions workflow that mirrors the Azure DevOps file uses the matching actions in the same order. The page lists no action for setting the solution version.
Microsoft’s samples reference @v1, and the page warns that “Using version 1 (@v1) might lead to updates to existing GitHub actions that can result in current workflows being updated.” Our view: treat @v1 as a tag that can change under you, pin a specific version deliberately, and treat any change in action behavior as a change to your pipeline.
The pack type is a real conflict, and Learn does not resolve it. The GitHub pack-solution action lists “Unmanaged (recommended)”. The Build Tools Pack task lists “Managed (recommended)”. Unpack recommends Unmanaged in both tools. Neither answer is Microsoft’s answer for both tools. Our view: decide explicitly for each repository and write the decision into your pipeline standard.
On runners, GitHub Actions for Microsoft Power Platform says the actions “can run on both Windows agents and Linux agents.” The exception is deploy-package, which Available GitHub Actions for Microsoft Power Platform development marks: “This action is only supported on Windows.”
The available-actions sample signs in with a user name and a password stored as a secret, and the overview page states that username/password authentication does not support multifactor authentication. Don’t copy that sign-in.
The better path is Use OIDC/FIC authentication with GitHub Actions. It sets up a Power Platform GitHub Actions workflow to “authenticate to Power Platform without storing a client secret.” The job is granted permission to request an ID token from GitHub. “The subject claim in GitHub and the subject identifier in your federated credential must match exactly.” The app registration is added as an application user with security roles in each target environment.
The limitation is that the tutorial’s sample runs only WhoAmI. Learn shows no export, import or deploy step signed in with OIDC.
# Our view: illustrative, not a Learn sample.
# From Microsoft's sample on Available GitHub Actions for Microsoft Power Platform development
- uses: microsoft/powerplatform-actions/actions-install@v1
- uses: microsoft/powerplatform-actions/export-solution@v1
# From Microsoft's sample in the OIDC/FIC tutorial
- uses: microsoft/powerplatform-actions/who-am-i@v1
The GitHub deployment tutorial uses separate dev, build and prod environments. Its workflow “Creates a managed solution and publishes it as a GitHub artifact” and “Imports the build artifact into the production environment.”
Takeaway. Our view: use OIDC/FIC for sign-in, then test your export, import and deploy steps under that identity yourself. Learn’s OIDC sample stops at WhoAmI.
Test: the gate Microsoft names, but Learn documents no built-in step for it
This is the stage where a Power Platform dev test prod pipeline usually gets thin. Microsoft documents several controls around it.
- Same artifact, in order. Pipelines enforce that “The same solution artifact must pass through pipeline stages in sequential order.” Run pipelines in Power Platform gives the example: “you can’t deploy version 1.0.0.1 to production before it has been deployed to test.”
- A separate test environment. Solution concepts says: “You can’t import a managed solution into the same environment that contains the originating unmanaged solution. To test a managed solution, you need a separate environment to import it into.”
- Preflight. The run page says “Missing dependencies and other common issues are checked that might cause a deployment to fail.”
Our view: solution checker enforcement is the strongest test control, and it belongs to managed environments, not to Pipelines. Solution checker enforcement in managed environments runs “when the solution is imported in the managed environment,” with three settings: None, Warn and Block. With Block, when a solution has highly critical issues, “the import process is canceled” before anything changes. The scope is narrower than the name suggests: “only critical severity rules block a solution from being imported,” and “You can select to exclude solution checker rules from enforcement.”
Learn documents no built-in test stage in Pipelines in Power Platform. Preflight checks dependencies, and enforcement checks patterns on import. Neither one runs your functional tests.
Gated extensions are where you add that step. According to Extend pipelines in Power Platform, “Pre-deployment Step Required provides additional flexibility to insert a custom step after a deployment is approved,” and such steps stay “in a pending state until your business logic executes and finally signals the pipelines host to complete or reject the step.”
Our view: turn on Pre-deployment Step Required for the production stage. Have a cloud flow on the OnPreDeploymentStarted trigger run your tests against the test environment, then call UpdatePreDeploymentStepStatus with 20 to complete the step or 30 to reject it. Microsoft’s sample trigger condition scopes a flow to one stage:
@equals(triggerOutputs()?['body/OutputParameters/DeploymentStageName'], 'Contoso UAT')
Check availability first, because Learn says “New pipeline extensions are gradually rolling out across regions and might not be available yet in your region.”
For the tests themselves, don’t start with Test Engine. Important changes coming in Power Platform says “Effective April 2026, Test Engine is deprecated.” Learn points to the Power Platform Playwright samples, an open-source repository that “Works headlessly in GitHub Actions, Azure Pipelines, and any Playwright-compatible environment.” They are samples you clone or fork, not a supported product.
Microsoft’s Well-Architected guidance says to “Implement quality gates throughout your code promotion process through testing” and to “integrate approval workflows into your quality gates.” It describes smoke tests as tests that verify “a workload can be stood up in a test environment and performs as expected.”
Takeaway. Our view: set solution checker enforcement to Block on the test and prod managed environments, and wire one Playwright smoke test into a pre-deployment step. That gives you one static gate and one behavioral gate. Both can stop promotion, though enforcement blocks only on critical severity rules.
Prod: Microsoft’s recommended route, your identity and your approval flow
Microsoft’s Well-Architected guidance on a secure development lifecycle says: “We recommend using Pipelines for Power Platform for your deployments. Extend pipelines using GitHub Actions.” It also says to “Explore the use of service principals for deployment.”
Targets must be managed environments, and enforcement is no longer theoretical. The admin deployment page says: “Pipeline target environments must be managed environments. Enforcement began rolling out in October 2026.” Its grace period table runs in this sequence:
- 1
Initial grace period
Thirty days from the first deployment to an unmanaged target. Deployments continue, admins are notified and makers see a warning.
- 2
Acknowledgement required
Deployments pause until a maker or tenant administrator acknowledges the prompt.
- 3
Extension
One time, for 30 days from acknowledgement.
- 4
Blocked
Deployments stop until a tenant administrator enables managed environments on the target.
The clock starts at “the first deployment to an unmanaged target,” so targets that are already managed are unaffected. “Previewing or validating a deployment doesn’t start the grace period.” The block hits new work only: “Enforcement blocks new deployments only. Deployed apps and solutions continue to run.” Enabling managed environments on the target removes the block immediately. Acknowledging the extension does not enable managed environments. In Learn’s words, “It only starts the one-time extension.” If you manage many targets, environment groups apply managed environment settings at scale.
The deploying identity is the next decision. Deploy pipelines as a service principal or pipeline owner makes the stage deploy “as the delegate (service principal or pipeline stage owner) instead of the requesting maker.” The role requirement is fixed: Deployment Pipeline Administrator in the pipelines host and System Administrator in target environments, because “Lower permission security roles can’t deploy plug-ins and other code components.” If that role assignment worries your security lead, the design questions in whether you can trust AI with Dataverse security apply to deploying identities too.
“All delegated deployments are pending until approved.” The admin builds that approval flow:
- the OnApprovalStarted trigger
- the UpdateApprovalStatus action, with 20 for approved and 30 for rejected
- a Dataverse connection for the service principal, where Learn says “You need a client ID and secret.”
The stage owner option is simpler to configure, but it cannot deploy solutions that contain connection references for OAuth connections. Our view: if any solution uses connection references for OAuth connections, default to the service principal. How strict the approval should be depends on what the solution touches, and the tiering logic in risk-tiered agent governance carries over to deployment approvals.
Configuration travels with the deployment on both routes. Pipelines “deploy solutions as well as configuration for the target environment such as connections, connection references, and environment variables.” On Route B, use the deployment settings file. Pre-populate connection references and environment variables, part of Microsoft’s ALM documentation, generates it with pac solution create-settings and says “You can store the JSON file in your source control system”. The Import Solution task reads it through UseDeploymentSettingsFile.
Route A has hard limits. All of them are on the Pipelines overview:
- Managed solutions only: “Can I deploy unmanaged solutions? No.”
- No table data: “Pipelines, or solutions in general, don’t contain data stored within Dataverse tables.”
- No other tenant: “We recommend using Azure DevOps or GitHub for this scenario.”
- One import behavior: “Pipelines default import behavior is Upgrade without Overwrite customizations.”
Takeaway. Our view: Learn documents no secretless option for the approval flow’s Dataverse connection, so store that client secret in a vault, assign it an owner and rotate it on a schedule.
Rollback is a set of partial tools, not a button
Learn documents no automatic rollback. It documents a set of tools that each cover part of the problem:
- The admin deployment page says failed deployments “can be retried by selecting Retry in the details panel if the operation was Deploy.”
- The Pipelines overview says that “If the pipeline setting is enabled, you can redeploy previous solution versions from the run history view on the Pipelines page.”
- Every deployment’s artifacts are stored in the pipelines host, so earlier versions still exist.
Environment backups are the heavier option, with limits. Back up and restore environments says backups are retained for seven days by default, and “for production managed environments, you can extend the retention period up to 28 days.” You cannot restore straight to production. You change the environment to sandbox, restore, and switch it back. After a restore, “Connection references require new connections.”
Uninstalling is not a way back either. Solution concepts warns that deleting a managed solution loses “data stored in custom tables that are part of the managed solution” along with data in its custom columns.
Microsoft’s Well-Architected guidance on safe deployments puts it plainly: “There are no low-risk deployments to production.” It also says to “Implement versioning across your build artifacts to help ensure that you can roll back and roll forward when necessary.”
Takeaway. Our view: make roll-forward the default and keep redeploying a previous version as the fallback. Learn’s backup page separately advises manual backups “before major customizations, applying a version update, or making significant changes to the environment.”
A second pair of eyes before your first gated release
Three pieces are left to you: the test gate inside a gated extension, the identity that deploys, and the approval flow’s secret.
If your team has the stage plan but has not built that test gate or locked down the deploying identity, Citizen Development Academy will review what you have built or plan to build with AI, name the top three risks, and recommend one next step.
Book a free 30-minute AI app review with Citizen Development Academy
Stay in the loop
Get new posts delivered to your inbox. No spam, unsubscribe anytime.
Related articles
Copilot Studio Agent Evaluation in a CI/CD Pipeline
Copilot Studio agent evaluation runs from a pipeline through REST, a connector and a preview CLI. Learn documents no built-in gate. Here is where the docs stop.
Dynamics 365 Sales MCP Server: Connect Claude Code or ChatGPT and Keep Control
Connect Claude Code or ChatGPT to the Dynamics 365 Sales MCP server: admin consent, two documented URLs, Copilot Credits, and which path writes CRM data.
Designing an Open-Source Product With Claude Code Sessions
How I designed Enterprise Applications Governance with Claude Code sessions in one weekend: the session split, the gates, the decision log, the human calls.