Having multiple Dataverse development environments? Do not use Power Platform Pipelines

Some time ago I was working on the simple Dynamics 365 Sales-based solution project. We had some customization and very little custom code there (only one developer is responsible for delivering it). We decided to use Power Platform Pipelines for deployment processes. We deployed the solution into production, were still working on system development and bug-fixing, and got used to Power Platform Pipelines as our release management platform.
The situation changed when our customer decided they needed to implement a large set of new functionalities. The implementation part of the project was estimated for almost half of the year. Of course they still wanted to develop small improvements and bug fixes for the existing system. It has occurred that a single development environment is not enough to meet this requirement. We have decided to prepare the environment setup illustrated in the picture below.

The blue ones are new environments created for the purpose of implementing and testing new functionality sets. A new development environment (CRM DEV-NF) has been created as a clone of the existing development one (CRM DEV), and a constant customization merge process has been implemented with Azure DevOps pipelines.
The problem occurred during first attempt of releasing our customization solution (let’s call it “ABC”) into CRM TEST-NF environment. The error message was:
There exists an artifact record with name 'ABC' and version '1.0.0.156', which is equal or greater than the target version '1.0.0.131'. Please specify a version larger than '1.0.0.156' to deploy to the first target stage.
What the hell? There was no solution installed with the '1.0.0.156' version. Actually there is no ABC solution installed at all in the CRM TEST-NF environment because it was a new, clean one. At first I thought that we misconfigured our new Power Platform release pipeline target environment, which still pointed to the “old” CRM test one. We were wrong. The reality was a little more complicated.
Power Platform Pipelines stores information about released artifacts’ history in the “Solution artifacts” table. There is information about the solution name, version, and release date here. It looks like Power Platform pipelines validate the solution version using only its name (and not name and target environment) using this table. In our case, because we released the ABC solution (version: 1.0.0.156) into the CRM TEST environment, we were blocked from releasing the lower ('1.0.0.131') one into the CRM TEST-NF environment because the last version of the solution name “ABC” in the “Solution artifacts” table was the bigger one.

Why solution version is validated in the Dataverse table instead of the target environment? I have no idea. Unfortunately for us it was a big blocker for us making it impossible to use Power Platform pipelines anymore. We decided to migrate our release pipelines into Azure DevOps environment. And lesson to learn is not to use Power Platform Pipelines on any kind of more complicated or non linear solutions flow.



