Import Power Apps Solution in Parallel to Different Environments Failed

Occasional Contributor

We have a release pipeline with 2 stages in parallel, Validation and Test. The tasks in these 2 stages are the same: import powerapps solution to the environment and apply upgrade, but they are using different service connections to the target environments. 


We set up self-hosted agent pool and install agents on the same local server.


When the pipeline was ran last night, Validation stage is using agent02, while Test stage is using agent01. The weird thing is the Test stage imported the solution to Validation environment althought the log showed that the command was to connect to Test environment at first, but then showed connecting the validation environment. As a result, Test stage import the solution to Validation environment, and the Validation stage failed because there already there is a upgrade solution imported by the Test stage.


Why did this happened? The 2 agents should be connected to different environment, why the Test stage connected to Validation environment wrongly?

1 Reply
The issue you're experiencing could be caused by a few different factors. I'll outline some common issues and troubleshooting steps to help you identify the root cause.

1- Check environment URLs and credentials in the service connections.

Ensure that the service connections for the Validation and Test stages are pointing to the correct environment URLs and have the correct credentials. Verify that there are no typos or copy-paste errors in the URLs, usernames, or passwords.

2- Check pipeline variable scoping.

If you're using pipeline variables for environment URLs, credentials, or other settings, ensure that the correct variable values are being used in each stage. If necessary, explicitly scope the variables to each stage to avoid potential issues with variable values getting mixed up between the stages.

Inspect the logs and output of each task.
Review the logs and output of each task in both the Validation and Test stages to ensure that the correct values are being used for environment URLs and credentials. If you see any inconsistencies or errors, try to trace the issue back to the appropriate part of your pipeline configuration.

4- Ensure proper agent isolation.
Although the agents are on the same local server, they should have separate working directories and configurations. Ensure that each agent is properly isolated from one another, and there is no chance of overlapping configurations or files.

5- Verify Power Apps CLI version.

6- Test stages independently.
As a troubleshooting step, try running the Validation and Test stages independently, one at a time. This will help you identify if the issue persists when the stages are run in isolation.

If none of these steps help to identify the root cause, you might want to reach out to Microsoft Support for further assistance. They can help you investigate the issue in more detail and identify any potential issues specific to your setup.