-
Notifications
You must be signed in to change notification settings - Fork 3.3k
Description
Related command
Currently if you have a put/patch request that is async, azure cli will just exit without showing anything because the response is empty.
$ az rest --method put --url https://management.azure.com/subscriptions/..../resourceGroups/..../providers/Microsoft.HybridCompute/machines/.../extensions/AzureMonitorLinuxAgent?api-version=2025-01-13 --body @arcextension.json add --debug if you want to see whats really happening.
It sends a 202 response and a header:
'Azure-AsyncOperation': 'https://management.azure.com/...'
which you need to poll until it's finished
I would like azure-cli rest to include this automatically, maybe behind a feature switch, to wait for the operation to finish. --wait-for-async or whatever :)
Is your feature request related to a problem? Please describe.
Right now you need to enable debug and manually get the url from there, then wait for it to finish etc
Describe the solution you'd like
New functionality that hides behind a arg option:
az rest --method put --url https://management.azure.com/subscriptions/..../resourceGroups/..../providers/Microsoft.HybridCompute/machines/.../extensions/AzureMonitorLinuxAgent?api-version=2025-01-13 --body @arcextension.json --wait-for-async
Additional context
The endpoint I have selected is just an example, there are tons more that are async.