question

wangjialu-9374 avatar image
0 Votes"
wangjialu-9374 asked tbgangav-MSFT answered

PowerShell Workflow Runbook about foreach -parallel

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
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

1 Answer

tbgangav-MSFT avatar image
0 Votes"
tbgangav-MSFT answered

Hi @wangjialu-9374,

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



image.png (77.3 KiB)
image.png (152.3 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.