PowerShell Workflow Runbook about foreach -parallel

wang jialu 51 Reputation points
2021-05-27T08:34:38.977+00:00

I find when I use foreach -parallel , all of them can stop ,Not all of them are running successfully,I tried to start it many times, but it still doesn't work;
it said :Start-AzApplicationGateway : Long running operation failed with status 'Failed'. Additional Info:'An error occurred.' At StopStartAppGW:42 char:42 + + CategoryInfo : CloseError: (:) [Start-AzApplicationGateway], CloudException + FullyQualifiedErrorId :Microsoft.Azure.Commands.Network.StartAzureApplicationGatewayCommand

Azure Automation
Azure Automation
An Azure service that is used to automate, configure, and install updates across hybrid environments.
1,198 questions
0 comments No comments
{count} votes

Accepted answer
  1. tbgangav-MSFT 10,421 Reputation points
    2021-05-27T10:35:33.437+00:00

    Hi @wang jialu ,

    Can you share the complete runbook so it helps to diagnose and troubleshoot the issue in a better way?

    Looking at the error 'long running operation failed', for long running Azure Automation tasks, it's recommended to use a Hybrid Runbook Worker. For more information, please refer this document. For illustration, added a screenshot below from the document.

    100255-image.png

    On the other hand, hope you have already reviewed this document. If not, I would recommend you to please read through it to learn about ForEach -Parallel construct which processes commands for each item in a collection concurrently. The items in the collection are processed in parallel while the commands in the script block run sequentially. For illustration, added a screenshot below from the document.

    100166-image.png

    0 comments No comments

0 additional answers

Sort by: Most helpful