Closed warren-li closed 2 years ago
@warren-li are you using the latest version of az cli that was released 05/06?
Version should be 2.23.0
when running az --version
@detienne20 yeah tried that same issues, and all is working on 23 April 2021, it only throw this error when we try deploy on 10/05/2021 with the same code base.
Manage to go around the issues, by port all the deployment group create to use arm template to do the template spec deployment.
it work and deploy, and only have minor issues on validation arm bug where there is another open issues from someone on azure devop post using the AzureResourceManagerTemplateDeployment@3 task.
@warren-li can you please run the command using --debug and share the full output here? Was the template spec created with az cli?
`cli.knack.cli: Command arguments: ['deployment', 'group', 'create', '--name', 'test', '--resource-group', 'rg-customer', '--template-spec', '/subscriptions/6cbe45a0-6565-4c4a-b1a9-0929f276bbcd/resourceGroups/rg-customer/providers/Microsoft.Resources/templateSpecs/ts-dev-st_customer_documents', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
Init colorama.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x03524190>, <function OutputProducer.on_global_arguments at 0x036A0028>, <function CLIQuery.on_global_arguments at 0x036B7BF8>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'deployment': ['azure.cli.command_modules.resource']
cli.azure.cli.core: Loading command modules:
cli.azure.cli.core: Name Load Time Groups Commands
cli.azure.cli.core: resource 0.022 37 176
cli.azure.cli.core: Total (1) 0.022 37 176
cli.azure.cli.core: Loaded 37 groups, 176 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : deployment group create
cli.azure.cli.core: Command table: deployment group create
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x03AC0100>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to 'C:\Users\Warren.Li.azure\commands\2021-05-13.13-57-16.deployment_group_create.18168.log'.
az_command_data_logger: command args: deployment group create --name {} --resource-group {} --template-spec {} --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/arm.py", line 100, in handle_template_based_exception AttributeError: 'KeyError' object has no attribute 'inner_exception'
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\knack/cli.py", line 231, in invoke File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 657, in execute File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 720, in _run_jobs_serially File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/init.py", line 712, in _run_job File "D:\a\1\s\build_scripts\windows\artifacts\cli\Lib\site-packages\azure/cli/core/commands/arm.py", line 102, in handle_template_based_exception knack.util.CLIError: 'template'
cli.azure.cli.core.azclierror: 'template' az_command_data_logger: 'template' cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x03AC0220>] az_command_data_logger: exit code: 1 cli.main: Command ran in 1.128 seconds (init: 0.208, invoke: 0.919) telemetry.save: Save telemetry record of length 3047 in cache telemetry.check: Negative: The C:\Users\Warren.Li.azure\telemetry.txt was modified at 2021-05-13 13:54:40.309220, which in less than 600.000000 s`
`azure-cli 2.23.0
core 2.23.0 telemetry 1.0.6
Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe' Extensions directory 'C:\Users\Warren.Li.azure\cliextensions'
Python (Windows) 3.8.9 (tags/v3.8.9:a743f81, Apr 6 2021, 13:22:56) [MSC v.1928 32 bit (Intel)]
Legal docs and information: aka.ms/AzureCliLegal
Your CLI is up-to-date.
Please let us know how we are doing: https://aka.ms/azureclihats and let us know if you're interested in trying out our newest features: https://aka.ms/CLIUXstudy`
@detienne20 sorry for the late reply, the above is my az --version and the output of the --debug.
@warren-li Thank you for your patience. The latest version of CLI will be released on 5/25. If you are still seeing this issue then, this might an issue with your installation, please reinstall and let us know if the issue persists then.
Closing this issue given we haven't received further follow-ups regarding this still being an issue after the June release.
Running
az deployment group create from az cli with --template-spec $id
would throw Error 'template'
Deploy using portal on template spec is fine.