Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Power Apps Pro Dev & ISV
Unanswered

Request: Detect if solution exists in environment

(0) ShareShare
ReportReport
Posted on by 15

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:

  • Update the Solution Import task to detect if the solution exists in the target environment, and then fallback to stage-and-upgrade if it does not exist. Similarly, update the Apply Upgrade task to detect if the solution can be upgraded, and if not, then simply continue instead of producing an error.
  • Provide a new Solution List task that outputs a list of solutions present in the target environment (in an easy-to-consume format like a JSON dictionary/object) so that the implementor can perform this check easily and set the correct import strategy on the Solution Import task
  • Provide a new Get Solution task, with a solution name input, and multiple outputs that match the pac solution list outputs for that single solution
  • Provide a new Check If Solution Exists task, with a solution name input, and a solution exists output (true/false)
  • davidjenkins Profile Picture
    15 on at
    Re: Request: Detect if solution exists in environment

    Thanks, @Andrew7 I've created the discussion here: https://github.com/microsoft/powerplatform-build-tools/discussions/900

  • Andrew7 Profile Picture
    Microsoft Employee on at
    Re: Request: Detect if solution exists in environment

    It might be good to share this idea here: microsoft/powerplatform-build-tools · Discussions · GitHub

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Power Apps Pro Dev & ISV

#1
WarrenBelz Profile Picture

WarrenBelz 85 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 57 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 55 Super User 2025 Season 1

Overall leaderboard