question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python error thrown with az role assignment create: AttributeError: 'RoleAssignmentsOperations' object has no attribute 'config'

See original GitHub issue

This 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:closed
  • Created 2 years ago
  • Comments:10 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
yrrocommented, Apr 29, 2022
1reaction
jiaslicommented, Feb 18, 2022

@DCMattyG, these are totally different issues:

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found