Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid argument in the management group deployment examples #680

Closed
2 tasks done
sergey-netdev opened this issue Nov 10, 2023 · 1 comment · Fixed by #681
Closed
2 tasks done

Invalid argument in the management group deployment examples #680

sergey-netdev opened this issue Nov 10, 2023 · 1 comment · Fixed by #681
Assignees

Comments

@sergey-netdev
Copy link
Contributor

What happened? Provide a clear and concise description of the bug, including deployment details.

Attempt to execute the deployment command causes the error.

unrecognized arguments: --management-group-id alz

It appears there is no --management-group-id argument in the latest version (2.53.1) of az deployment tenant create.
https://github.com/Azure/ALZ-Bicep/tree/main/infra-as-code/bicep/modules/managementGroups

Please provide the correlation id associated with your error or bug.

xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

What was the expected outcome?

Successful deployment

Relevant log output

PS C:\projects\ABC\bicep\modules\managementGroups> az deployment tenant create --name ${NAME} --location $LOCATION --template-file $TEMPLATEFILE --parameters $PARAMETERS --management-group-id $MGID
unrecognized arguments: --management-group-id alz

PS C:\projects\ABC\bicep\modules\managementGroups> az --version
azure-cli                         2.53.1

core                              2.53.1
telemetry                          1.1.0

Dependencies:
msal                            1.24.0b2
azure-mgmt-resource             23.1.0b2

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
Extensions directory 'C:\Users\YYY\.azure\cliextensions'

Python (Windows) 3.10.10 (tags/v3.10.10:aad5f6a, Feb  7 2023, 17:05:00) [MSC v.1929 32 bit (Intel)]

Legal docs and information: aka.ms/AzureCliLegal


Your CLI is up-to-date.
PS C:\projects\ABC\bicep\modules\managementGroups> az deployment tenant create --help

Command
    az deployment tenant create : Start a deployment at tenant scope.
        Please specify only one of --template-file FILE | --template-uri URI | --template-spec to
        input the ARM template.

Arguments
    --location -l                      [Required] : The location to store the deployment metadata.
    --confirm-with-what-if -c                     : Instruct the command to run deployment What-If
                                                    before executing the deployment. It then prompts
                                                    you to acknowledge resource changes before it
                                                    continues.
    --handle-extended-json-format -j [Deprecated] : Support to handle extended template
                                                    content including multiline and comments in
                                                    deployment.
        Option '--handle-extended-json-format/-j' has been deprecated and will be removed in a
        future release.
    --name -n                                     : The deployment name.
    --no-prompt                                   : The option to disable the prompt of missing
                                                    parameters for ARM template. When the value is
                                                    true, the prompt requiring users to provide
                                                    missing parameter will be ignored. The default
                                                    value is false.  Allowed values: false, true.
    --no-wait                                     : Do not wait for the long-running operation to
                                                    finish.
    --parameters -p                               : Supply deployment parameter values.
        Parameters may be supplied from a file using the `@{path}` syntax, a JSON string, or as
        <KEY=VALUE> pairs. Parameters are evaluated in order, so when a value is assigned twice, the
        latter value will be used. It is recommended that you supply your parameters file first, and
        then override selectively using KEY=VALUE syntax.
    --proceed-if-no-change                        : Instruct the command to execute the deployment
                                                    if the What-If result contains no resource
                                                    changes. Applicable when --confirm-with-what-if
                                                    is set.
    --query-string -q                             : The query string (a SAS token) to be used with
                                                    the template-uri in the case of linked
                                                    templates.
    --template-file -f                            : The path to the template file or Bicep file.
    --template-spec -s                            : The template spec resource id.
    --template-uri -u                             : The URI to the template file.
    --what-if -w                                  : Instruct the command to run deployment What-If.
    --what-if-exclude-change-types -x             : Space-separated list of resource change types to
                                                    be excluded from What-If results. Applicable
                                                    when --confirm-with-what-if is set.  Allowed
                                                    values: Create, Delete, Deploy, Ignore, Modify,
                                                    NoChange, Unsupported.
    --what-if-result-format -r                    : The format of What-If results. Applicable when
                                                    `--confirm-with-what-if` is set.  Allowed
                                                    values: FullResourcePayloads, ResourceIdOnly.
                                                    Default: FullResourcePayloads.

Global Arguments
    --debug                                       : Increase logging verbosity to show all debug
                                                    logs.
    --help -h                                     : Show this help message and exit.
    --only-show-errors                            : Only show errors, suppressing warnings.
    --output -o                                   : Output format.  Allowed values: json, jsonc,
                                                    none, table, tsv, yaml, yamlc.  Default: json.
    --query                                       : JMESPath query string. See http://jmespath.org/
                                                    for more information and examples.
    --subscription                                : Name or ID of subscription. You can configure
                                                    the default subscription using `az account set
                                                    -s NAME_OR_ID`.
    --verbose                                     : Increase logging verbosity. Use --debug for full
                                                    debug logs.

Examples
    Create a deployment at tenant scope from a remote template file, using parameters from a local
    JSON file.
        az deployment tenant create --name rollout01 --location WestUS \
            --template-uri https://myresource/azuredeploy.json --parameters @myparameters.json


    Create a deployment at tenant scope from a local template file, using parameters from a JSON
    string.
        az deployment tenant create --name rollout01 --location WestUS \
            --template-file azuredeploy.json \
            --parameters '{ \"policyName\": { \"value\": \"policy2\" } }'


    Create a deployment at tenant scope from a local template, using a parameter file, a remote
    parameter file, and selectively overriding key/value pairs.
        az deployment tenant create --name rollout01 --location WestUS \
            --template-file azuredeploy.json  --parameters @params.json \
            --parameters https://mysite/params.json --parameters MyValue=This MyArray=@array.json


To search AI knowledge base for examples, use: az find "az deployment tenant create"

Check previous GitHub issues

  • I have searched the issues for this item and found no duplicate

Code of Conduct

  • I agree to follow this project's Code of Conduct
jtracey93 added a commit that referenced this issue Nov 10, 2023
@jtracey93 jtracey93 mentioned this issue Nov 10, 2023
10 tasks
@jtracey93
Copy link
Collaborator

Hey @sergey-netdev,

Thanks for the issue, apolgoies this is a typo in the docs that i have fixed in PR #681

If using the managementGroupsScopeEscape.bicep module then the command you'll need is az deployment mg create --name ${NAME:0:63} --location $LOCATION --template-file $TEMPLATEFILE --parameters $PARAMETERS --management-group-id $MGID

@jtracey93 jtracey93 self-assigned this Nov 10, 2023
jtracey93 added a commit that referenced this issue Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants