Python error thrown with az role assignment create: AttributeError: 'RoleAssignmentsOperations' object has no attribute 'config'
See original GitHub issueThis is autogenerated. Please review and update as needed.
Describe the bug
Command Name
az role assignment create
Errors:
The command failed with an unexpected error. Here is the traceback:
'RoleAssignmentsOperations' object has no attribute 'config'
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/knack/cli.py", line 231, in invoke
cmd_result = self.invocation.execute(args)
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/__init__.py", line 658, in execute
raise ex
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/__init__.py", line 721, in _run_jobs_serially
results.append(self._run_job(expanded_arg, cmd_copy))
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/__init__.py", line 692, in _run_job
result = cmd_copy(params)
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/__init__.py", line 328, in __call__
return self.handler(*args, **kwargs)
File "/usr/lib/python3/dist-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
return op(**command_args)
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/role/custom.py", line 166, in create_role_assignment
return _create_role_assignment(cmd.cli_ctx, role, object_id, resource_group_name, scope, resolve_assignee=False,
File "/usr/lib/python3/dist-packages/azure/cli/command_modules/role/custom.py", line 183, in _create_role_assignment
assignments_client.config.subscription_id)
AttributeError: 'RoleAssignmentsOperations' object has no attribute 'config'
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 role assignment create --role {} --assignee {} --scope {}
Expected Behavior
Environment Summary
Linux-5.15.15-1rodete1-amd64-x86_64-with-glibc2.33, Debian GNU/Linux rodete
Python 3.9.9
Installer: DEB
azure-cli 2.32.0 *
Extensions:
azure-devops 0.22.0
Dependencies:
msal 1.16.0
azure-mgmt-resource 20.0.0
Additional Context
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (3 by maintainers)
Top Results From Across the Web
RoleAssignmentsOperations Class - Microsoft Learn
The scope of the role assignment to create. The scope can be any REST resource instance. For example, use '/subscriptions/{subscription-id}/' for a ...
Read more >Azure Python SDK Error - Stack Overflow
I have written python code to get azure resources ...
Read more >azure-mgmt-authorization - PyPI
Microsoft Azure Authorization Management Client Library for Python. ... The config attribute no longer exists on a client, configuration should be passed as ......
Read more >Azure SDK for Python Documentation - Read the Docs
Parameters principal_id (str) – Returns role assignment of the specific ... update even if the extension configuration has not changed.
Read more >An Event Hub Triggered Azure Function using Python example
When I created my Event Hub triggered Azure Function cardinality ... Exception: AttributeError: 'list' object has no attribute 'get_body'.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I have a patch for this at https://github.com/Azure/azure-cli/issues/22231#issuecomment-1113136152
@DCMattyG, these are totally different issues:
k8s-configuration
extension issue owned by service team