Task to detect if solution exists in environment #900
Replies: 3 comments 3 replies
-
Hoping for this to be implemented :) |
Beta Was this translation helpful? Give feedback.
-
I pretty much concur, although some of the work is already in place. ADO Pipeline deploying with There is a webapi query to However it then does StageSolution request followed by StageAndUpgradeAsync which hits the issue. Without the --stage-and-update argument a ImportSolutionAsync request is made, which is correct. So in short, for --stage-and-upgade if the solution exists, it should do StageAndUpgrade, else ImportSolution. In PAC, there is pack package deploy --solution $solutionFile which handles individual solutions using a runtime built package, but this isn't available in ADO Pipelines tasks. |
Beta Was this translation helpful? Give feedback.
-
Agree with this proposal. I currently have a custom PowerShell script executed before an attempted solution import, which detects whether a version of the solution to be attempted is already present in the target environment and if so which version. This script is based on |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
THE PROBLEM:
It is often required that solutions be deployed using Azure DevOps Pipelines. Sometimes there are often several iterations or environment rebuilds that must occur before the initial go-live of a solution, meaning that importing the solution into an environment for the first time (or after a rebuild) must use the stage-and-upgrade strategy rather than the import-as-holding strategy. However, subsequent imports into that same environment may require the import-as-holding strategy (e.g. deployment consists of multiple layer solutions or mid-deployment tasks must be carried out before upgrade occurs). However, importing the solution as a holding solution will fail if the solution does not already exist in the environment.
CURRENT LANDSCAPE:
Currently, Microsoft does not provide a task or simple method for detecting if a solution already exists in an environment, and the current Solution Import task will not perform this detection either. It is left to the implementor to find a way around this problem. Running the PAC CLI inside the pipeline is one option (
pac solution list
), but setting this up and parsing the output is a nuisance and too much effort for some people. We also can't be certain that the format of the CLI output will remain constant, meaning a change in format could break whatever parsing mechanism we assemble.Third party tools might be another option, but some orgs or not too keen on the idea of granting third party party code access to their environments or repos.
THE ASK:
Any of the following enhancements to the suite Power Platform Build Tools:
pac solution list
outputs for that single solutionBeta Was this translation helpful? Give feedback.
All reactions