Azure / azure-powershell

Microsoft Azure PowerShell
Other
4.26k stars 3.86k forks source link

[Doc]: Update-* commands which use GET/PUT are supported, but undocumented #26677

Open sardobi opened 3 days ago

sardobi commented 3 days ago

Type of issue

Missing information

Feedback

(This is about the engineering docs.)

We've been working on AutoRest-based cmdlets for a resource provider which has very limited support for PATCH requests. We wanted to have an Update-* cmdlet for our resource, but didn't think that was possible, since by default the generated cmdlet will use PATCH requests to update the resource.

However, having asked in help channels, it seems there is an alternative. Per @VeryEarly:

...we provided a simpler way for these scenarios, if you use certain directive (in README.md) to remove patch API, we will generate an Update cmdlet which does Get then Put in one shot.

...this line: azure-powershell/src/Storage/Storage.Autorest/README.md at ccf7f84061bd622a2ba094755ebabd30d2bc546a · Azure/azure-powershell (github.com) showcased how to remove a certain operation, please find the operationid in swagger for the patch API you want to remove as the value.

This is super useful, but I don't think it is documented.

Page URL

https://github.com/Azure/azure-powershell/blob/main/documentation/development-docs/examples/update-cmdlet-example.md

Content source URL

https://github.com/Azure/azure-powershell/blob/main/documentation/development-docs/examples/update-cmdlet-example.md?plain=1

Author

No response

Document Id

No response

VeryEarly commented 2 days ago

Hi @sardobi ,

We have engineering hub page for autorest.powershell, please refer to it while developing autorest generated modules, and we will add introduction for GET/PUT there, thanks.