add bicep generate sub-command to azure cli (az) tool
Source the bash script file .az_bicep_generate.sh in your current shell.
. .az_bicep_generate.shIt can be automatically sourced by adding the following to your .bashrc file:
. .az_bicep_generate.shTo generate a bicep file from the existing Azure Resource Group, run the following command:
az bicep generate --resource-group-name <resource-group-name> --output-file <output-file>If --output-file argument is not specified, the bicep file will be generated with the Resource Group name, for example:
az bicep generate --resource-group-name rg-testWill generate rg-test.bicep file in the current directory.
If --resource-group-name argument is not specified, usage message will be displayed on the terminal.