Shaun Luttin
Shaun Luttin

Reputation: 141442

Debugging Azure Functions throws error, "The pipeline was not run because a pipeline is already running. Pipelines cannot be run concurrently."

Background

We followed these instructions to debug a PowerShell Azure Function in VS Code. This is the error we experience.

Internal Error - System.Management.Automation.PSInvalidOperationException: The pipeline was not run because a pipeline is already running. Pipelines cannot be run concurrently.

The GitHub issues indicate that this is an open issue that has not been resolved. Here is a starting place for the issues and comments about the problem: https://github.com/microsoft/vscode-azurefunctions/issues/2776

Question

Does that mean that debugging Azure PowerShell Functions with VS Code is currently broken? If not, what is the workaround to make the debugging work in VS Code?

What Have We Tried?

  1. Open the function in VS Code.
  2. Add Wait-Debugger immediately after params.
  3. Ensure the PowerShell session is using PowerShell Core 6+.
  4. Stop the function in the Azure Portal.
  5. Run Get-PSHostProcessInfo locally to ensure there is no dotnet process.
  6. From VS Code, Attach to PowerShell Functions with the following config.
{
    "name": "Attach to PowerShell Functions",
    "type": "PowerShell",
    "request": "attach",
    "customPipeName": "AzureFunctionsPSWorker",
    "runspaceId": 1,
    "preLaunchTask": "func: host start"
}

The error then appears.

Upvotes: 0

Views: 638

Answers (1)

AjayKumarGhose
AjayKumarGhose

Reputation: 4883

I tried to reproduce the issue but i could not get any pipeline error in Azure PowerShell function .

I have created a PowerShell function in vs code and deploy it to Azure after successfully test locally .

  • installed extension in vs code PowerShell .

enter image description here

After deploying stop the function app in Portal and trying to debug in my local as mentioned in the MS DOC When using PowerShell 7, we don't need to add the Wait-Debugger call in our code. After that we can refresh and debug .

enter image description here

enter image description here

enter image description here

enter image description here

Note: Please make sure to use PowerShell v5 or v7 .

Upvotes: 1

Related Questions