Power Platform Import Solution option StageAndUpgrade does not stage solution for upgrade
Issue
Plugins registered to both OOTB message and custom actions fail with error:
"Entity 'solution' With Id = 35e53140-4354-4068-839c-21f6331cef8d Does Not Exist"
You may also see this error message when importing a solution, causing the solution import to fail.
Cause
When using build task Power Platform Import Solution with option StageAndUpgrade set to true, solution is not staged for import, and no upgrade is applied to solution.
The StageAndUpgrade option was enabled late 2023 as described in the release notes:
Solution Import details
Image below shows:
- YELLOW - Imported solution using PP build tools in ADO pipelines using
StageAndUpgradeset to `true - RED - Imported solution using classic UI, staging solution for upgrade, then applying upgrade
I would expect to see an install and uninstall step for a solution import using StageAndUpgrade.
Pipeline Step config
Our ADO pipeline imports the solution using the following configuration:
- task: PowerPlatformImportSolution@2
displayName: 'Importing Holding Solution: xxx'
condition: xxx
inputs:
authenticationType: xxx
PowerPlatformSPN: xxx
SolutionInputFile: 'xxx'
AsyncOperation: true
MaxAsyncWaitTime: '60'
OverwriteUnmanagedCustomizations: true
StageAndUpgrade: true
SkipLowerVersion: true
ConvertToManaged: true
PublishCustomizationChanges: true
Either the StageAndUpgrade option is not working or we have implemented it incorrectly.
Workaround
ADO Pipelines can revert to the older two-step solution import method, where
- ADO pipeline task 1 imports the solution as holding using task
PowerPlatformImportSolution@2and flagHoldingSolution: true - ADO pipeline task 2 upgrades the solution using task
PowerPlatformApplySolutionUpgrade@2
Example Workaround
- task: PowerPlatformImportSolution@2
displayName: 'Importing Holding Solution: xxx'
condition: xxx
inputs:
authenticationType: xxx
PowerPlatformSPN: xxx
SolutionInputFile: xxx
AsyncOperation: true
MaxAsyncWaitTime: '60'
OverwriteUnmanagedCustomizations: true
HoldingSolution: true
SkipLowerVersion: true
ConvertToManaged: true
PublishCustomizationChanges: true
- task: PowerPlatformApplySolutionUpgrade@2
inputs:
authenticationType: xxx
PowerPlatformSPN: $xxx
SolutionName: xxx
AsyncOperation: true
MaxAsyncWaitTime: '60'
@CoreySutton - Why is ConvertToManaged set to true if you already have the managed solution in the target environment?
@rajyraman The CovertToManaged flag allows the solution import to convert unmanaged components in the target environment into managed, which is useful when you retroactively move to managed solutions in an existing environment.
Is this issue going to be addressed? I am experiencing it consistently with one of the QA environments that I push to, yet the same options work fine in production. Would it help to look at an environment that has this issue?