3

As part of our release deployment, we use an Azure Powershell step in our Release Pipeline to use DACPAC to update our databases. This currently iterates through each of these databases and updates them sequentially. At approximately 35 – 40 seconds per database, this step in the process is taking almost an hour (around 100 dbs) and will continue to grow as customers grows and so databases.

I have been researching and have found that Powershell 7 now supports parallel execution. However, Azure DevOps does not officially support this. In my research, however, I am finding that some users out in the industry are somehow running Powershell 7 in their deployments.

Is there any way, how we can achieve parallel execution of Powerlshell 7 scripts on DevOps?

2 Answers 2

8

To run the Powershell 7 script on DevOps, you need to explicitly select the option to use Powershell core (v 7.0.3) in Azure DevOps. Powershell 6 onwards it is now known as Powershell core and is launched as pwsh.exe. PowerShell Core runs side-by-side with Windows PowerShell and by default when you are using the Powershell task on Azure DevOps it uses normal powershell (i.e. v 5.1). So, when running without this Powershell default to the normal powershell.exe which does not have this feature.

We can enable Powershell core on Azure DevOps task using the checkbox Use Powershell Core under Advanced settings of the task and use the parallel feature.

Sign up to request clarification or add additional context in comments.

Comments

0

As workaround ,you can consider to run parallel jobs in the pipeline and add azure powershell task to each job. In Azure Pipelines, you can run parallel jobs on Microsoft-hosted infrastructure or your own (self-hosted) infrastructure.

View available parallel jobs: Browse to Organization settings > Pipelines > Retention and parallel jobs > Parallel jobs.

For details ,please refer to this official document.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.