Open jiasli opened 1 year ago
Helper command implementation
As discussed, it is user's responsibility to know how to generate GUID in different platforms. It shouldn't be part of Azure CLI's functionality.
Another cross-platform solution is to utilize python
to generate a GUID:
python -c "import uuid; print(uuid.uuid4())"
Is your feature request related to a problem? Please describe.
az role assignment create
now supports bring-your-own role assignment name with the newly introduced--name
argument (https://github.com/Azure/azure-cli/pull/24324). APIs such as Role Assignments - Create requires a GUID as the resource name, but there is no cross-platform way to generate a GUID.PowerShell: https://learn.microsoft.com/en-us/powershell/module/microsoft.powershell.utility/new-guid?view=powershell-7.3
Bash: https://manpages.ubuntu.com/manpages/jammy/man1/uuidgen.1.html
Other commands also create or use GUIDs:
az vm create
creates a new GUID if Managed Service Identity Arguments are specified.az keyvault role assignment create
supports--name
as the role assignment name.Describe the solution you'd like
Helper command
az util create-guid
to create a GUID that can be consumed by other commands.