Skip to content

Azure CLI bug -> az group create | No module named 'azure.mgmt.resource.deploymentstacks' #27203

@Superb-Nightwolf

Description

@Superb-Nightwolf

Describe the bug

import fail / bug in lib -> No module named 'azure.mgmt.resource.deploymentstacks'

Related command

az group create

Errors

The command failed with an unexpected error. Here is the traceback:
No module named 'azure.mgmt.resource.deploymentstacks'
Traceback (most recent call last):
File "/home/bhalachandra/.local/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 561, in execute
self.commands_loader.load_arguments(command)
File "/home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/core/init.py", line 522, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
File "/home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/command_modules/resource/init.py", line 33, in load_arguments
load_arguments(self, command)
File "/home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/command_modules/resource/_params.py", line 15, in load_arguments
from azure.mgmt.resource.deploymentstacks.models import DenySettingsMode
ModuleNotFoundError: No module named 'azure.mgmt.resource.deploymentstacks'

Issue script & Debug output

bhalachandra [ ~ ]$ az group create --debug
cli.knack.cli: Command arguments: ['group', 'create', '--debug']
cli.knack.cli: init debug log:
Enable color in terminal.
cli.knack.cli: Event: Cli.PreExecute []
cli.knack.cli: Event: CommandParser.OnGlobalArgumentsCreate [<function CLILogging.on_global_arguments at 0x7fd138501160>, <function OutputProducer.on_global_arguments at 0x7fd13841e820>, <function CLIQuery.on_global_arguments at 0x7fd1383afdc0>]
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableCreate []
cli.azure.cli.core: Modules found from index for 'group': ['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.014 51 224
cli.azure.cli.core: Total (1) 0.014 51 224
cli.azure.cli.core: These extensions are not installed and will be skipped: ['azext_next']
cli.azure.cli.core: Loading extensions:
cli.azure.cli.core: Name Load Time Groups Commands Directory
cli.azure.cli.core: ai-examples 0.146 1 1 /usr/lib/python3.9/site-packages/azure-cli-extensions/ai-examples
cli.azure.cli.core: Total (1) 0.146 1 1
cli.azure.cli.core: Loaded 52 groups, 225 commands.
cli.azure.cli.core: Found a match in the command table.
cli.azure.cli.core: Raw command : group create
cli.azure.cli.core: Command table: group create
cli.knack.cli: Event: CommandInvoker.OnPreCommandTableTruncate [<function AzCliLogging.init_command_file_logging at 0x7fd137857d30>]
cli.azure.cli.core.azlogging: metadata file logging enabled - writing logs to '/home/bhalachandra/.azure/commands/2023-08-20.08-39-31.group_create.310.log'.
az_command_data_logger: command args: group create --debug
cli.knack.cli: Event: CommandInvoker.OnPreArgumentLoad [<function register_global_subscription_argument..add_subscription_parameter at 0x7fd13787e8b0>]
cli.azure.cli.core.azclierror: Traceback (most recent call last):
File "/home/bhalachandra/.local/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 561, in execute
self.commands_loader.load_arguments(command)
File "/home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/core/init.py", line 522, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
File "/home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/command_modules/resource/init.py", line 33, in load_arguments
load_arguments(self, command)
File "/home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/command_modules/resource/_params.py", line 15, in load_arguments
from azure.mgmt.resource.deploymentstacks.models import DenySettingsMode
ModuleNotFoundError: No module named 'azure.mgmt.resource.deploymentstacks'

cli.azure.cli.core.azclierror: The command failed with an unexpected error. Here is the traceback:
az_command_data_logger: The command failed with an unexpected error. Here is the traceback:
cli.azure.cli.core.azclierror: No module named 'azure.mgmt.resource.deploymentstacks'
Traceback (most recent call last):
File "/home/bhalachandra/.local/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 561, in execute
self.commands_loader.load_arguments(command)
File "/home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/core/init.py", line 522, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
File "/home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/command_modules/resource/init.py", line 33, in load_arguments
load_arguments(self, command)
File "/home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/command_modules/resource/_params.py", line 15, in load_arguments
from azure.mgmt.resource.deploymentstacks.models import DenySettingsMode
ModuleNotFoundError: No module named 'azure.mgmt.resource.deploymentstacks'
az_command_data_logger: No module named 'azure.mgmt.resource.deploymentstacks'
Traceback (most recent call last):
File "/home/bhalachandra/.local/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 561, in execute
self.commands_loader.load_arguments(command)
File "/home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/core/init.py", line 522, in load_arguments
loader.load_arguments(command) # this adds entries to the argument registries
File "/home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/command_modules/resource/init.py", line 33, in load_arguments
load_arguments(self, command)
File "/home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/command_modules/resource/_params.py", line 15, in load_arguments
from azure.mgmt.resource.deploymentstacks.models import DenySettingsMode
ModuleNotFoundError: No module named 'azure.mgmt.resource.deploymentstacks'
To check existing issues, please visit: https://github.com/Azure/azure-cli/issues
cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7fd137857f70>]
az_command_data_logger: exit code: 1
cli.main: Command ran in 0.454 seconds (init: 0.121, invoke: 0.334)
telemetry.main: Begin splitting cli events and extra events, total events: 1
telemetry.client: Accumulated 0 events. Flush the clients.
telemetry.main: Finish splitting cli events and extra events, cli events: 1
telemetry.save: Save telemetry record of length 7166 in cache
telemetry.main: Begin creating telemetry upload process.
telemetry.process: Creating upload process: "/usr/bin/python3 /home/bhalachandra/.local/lib/python3.9/site-packages/azure/cli/telemetry/init.py /home/bhalachandra/.azure"
telemetry.process: Return from creating process
telemetry.main: Finish creating telemetry upload process.

Expected behavior

Create a new resource group.

Environment Summary

bhalachandra [ ~ ]$ az --version
azure-cli 2.51.0

core 2.51.0
telemetry 1.1.0

Extensions:
ai-examples 0.2.5
ml 2.19.1
ssh 2.0.1

Dependencies:
msal 1.24.0b1
azure-mgmt-resource 22.0.0

Python location '/usr/bin/python3'
Extensions directory '/home/bhalachandra/.azure/cliextensions'
Extensions system directory '/usr/lib/python3.9/site-packages/azure-cli-extensions'

Python (Linux) 3.9.14 (main, Feb 8 2023, 03:39:52)
[GCC 11.2.0]

Legal docs and information: aka.ms/AzureCliLegal

Your CLI is up-to-date.

Additional context

chrome_o7HTfCNR08
chrome_ykKKdr4IJk

Metadata

Metadata

Assignees

Labels

ARMaz resource/group/lock/tag/deployment/policy/managementapp/account management-groupAuto-AssignAuto assign by botAzure CLI TeamThe command of the issue is owned by Azure CLI teamcustomer-reportedIssues that are reported by GitHub users external to the Azure organization.questionThe issue doesn't require a change to the product in order to be resolved. Most issues start as that

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions