powerplatform-build-tools icon indicating copy to clipboard operation
powerplatform-build-tools copied to clipboard

Power Platform Import Solution option StageAndUpgrade does not stage solution for upgrade

Open CoreySutton opened this issue 2 years ago • 5 comments

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: image

Solution Import details

Image below shows:

  1. YELLOW - Imported solution using PP build tools in ADO pipelines using StageAndUpgrade set to `true
  2. 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.

image

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

  1. ADO pipeline task 1 imports the solution as holding using task PowerPlatformImportSolution@2 and flag HoldingSolution: true
  2. 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 avatar Jan 26 '24 00:01 CoreySutton

@CoreySutton - Why is ConvertToManaged set to true if you already have the managed solution in the target environment?

rajyraman avatar Feb 10 '24 03:02 rajyraman

@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.

Covert to managed docs

CoreySutton avatar Feb 26 '24 00:02 CoreySutton

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?

TarogStar avatar Sep 13 '24 20:09 TarogStar