Azure / Azure/azure-cli-extensions

AttributeError: 'AssignmentsOperations' object has no attribute 'cli_ctx'

Open
#6,211 11 comments 0 reactions 0 assignees View on GitHub
Azure CLI Team Blueprint bug needs-team-attention Service Attention
Dominant language
Python
Stars
454
Forks
1.7k
Avg merge
2d 19h
Merged PRs (30d)
64

Description

- If the issue is to do with Azure CLI 2.0 in-particular, create an issue here at [Azure/azure-cli](https://github.com/Azure/azure-cli/issues)

### Related command

### Extension name (the extension in question)

blueprint
### Description of issue (in as much detail as possible)
Command Name
az blueprint assignment update Extension Name: blueprint. Version: 0.3.1.

Errors:

`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: 'AssignmentsOperations' object has no attribute 'cli_ctx'
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.47.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/homebrew/Cellar/azure-cli/2.47.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.47.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/opt/homebrew/Cellar/azure-cli/2.47.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
result = cmd_copy(params)
File "/opt/homebrew/Cellar/azure-cli/2.47.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
return self.handler(*args, **kwargs)
File "/opt/homebrew/Cellar/azure-cli/2.47.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "/Users/ozgen/.azure/cliextensions/blueprint/azext_blueprint/custom.py", line 671, in update_blueprint_assignment
_assign_owner_role_in_target_scope(client, resource_scope, spn)
File "/Users/ozgen/.azure/cliextensions/blueprint/azext_blueprint/custom.py", line 612, in _assign_owner_role_in_target_scope
role_assignments = list_role_assignments(cmd, assignee=spn_object_id, role='Owner', scope=role_scope)
File "/opt/homebrew/Cellar/azure-cli/2.47.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/role/custom.py", line 222, in list_role_assignments
graph_client = _graph_client_factory(cmd.cli_ctx)
AttributeError: 'AssignmentsOperations' object has no attribute 'cli_ctx'
az_command_data_logger: 'AssignmentsOperations' object has no attribute 'cli_ctx'
Traceback (most recent call last):
File "/opt/homebrew/Cellar/azure-cli/2.47.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
cmd_result = self.invocation.execute(args)
File "/opt/homebrew/Cellar/azure-cli/2.47.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
raise ex
File "/opt/homebrew/Cellar/azure-cli/2.47.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 726, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/opt/homebrew/Cellar/azure-cli/2.47.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
result = cmd_copy(params)
File "/opt/homebrew/Cellar/azure-cli/2.47.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
return self.handler(*args, **kwargs)
File "/opt/homebrew/Cellar/azure-cli/2.47.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "/Users/ozgen/.azure/cliextensions/blueprint/azext_blueprint/custom.py", line 671, in update_blueprint_assignment
_assign_owner_role_in_target_scope(client, resource_scope, spn)
File "/Users/ozgen/.azure/cliextensions/blueprint/azext_blueprint/custom.py", line 612, in _assign_owner_role_in_target_scope
role_assignments = list_role_assignments(cmd, assignee=spn_object_id, role='Owner', scope=role_scope)
File "/opt/homebrew/Cellar/azure-cli/2.47.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/role/custom.py", line 222, in list_role_assignments
graph_client = _graph_client_factory(cmd.cli_ctx)
AttributeError: 'AssignmentsOperations' object has no attribute 'cli_ctx'
`

To Reproduce:
Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

Put any pre-requisite steps here...

`az blueprint assignment update --name {} --location {} --identity-type {} --locks-mode {} --blueprint-version {} --parameters {} --subscription {}`

Environment Summary

Installer: linux-latest

azure-cli 2.47.0 *

Extensions:
blueprint 0.3.1

-----

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.