azure-powershell icon indicating copy to clipboard operation
azure-powershell copied to clipboard

Give Invoke-AzResourceAction powershell cmdlet a synchronous mode

Open buchs opened this issue 5 years ago • 7 comments

Description of the new feature

Invoke-AzResourceAction, Powershell cmdlet, https://docs.microsoft.com/en-us/powershell/module/az.resources/invoke-azresourceaction?view=azps-2.8.0, currently runs asynchronously. It returns immediately but it is still working on the operation. The user must poll for a resource to be created and then check the provisioningstatus of that resource. The Azure CLI runs the comparative command synchronously, so it pauses until it is done. Could you at least create a parameter for Invoke-AzResourceAction so that it would run synchronously.

Proposed implementation details (optional)

In other cases for async/sync operation you have -NoWait flag to trigger async so for consistency, lacking that flag should be the sync default. However, it now runs as async, so for the least breakage, you may want to add a -Wait flag.

You can no doubt implement this exactly as the CLI does.

buchs avatar Oct 16 '19 21:10 buchs

@buchs thanks for submitting this inconsistency between the two tools. Our strategy is to reduce the differences between them and this falls in this category.

dcaro avatar Nov 28 '19 01:11 dcaro

@ravbhatnagar, @Tiano2017 can you please have a look?

dcaro avatar Nov 28 '19 01:11 dcaro

+1 on this request. We need a way to check if the aysnc operation is actually successful out of the box.

eosho avatar Sep 13 '20 14:09 eosho

@raych1 Should your team own the solution for this? Or is there an issue with a dependency you are taking on ARM?

jennyhunter-msft avatar Jan 23 '21 01:01 jennyhunter-msft

@raych1 Should your team own the solution for this? Or is there an issue with a dependency you are taking on ARM?

+@dcaro , @dingmeng-xue to comment.

raych1 avatar Jan 25 '21 07:01 raych1

No developer works on this cmdlet for couple years. We will check its owner.

dingmeng-xue avatar Jan 25 '21 09:01 dingmeng-xue

+1 for this request. Please look into the feature requst

bniranjanbhat avatar Apr 25 '24 06:04 bniranjanbhat