Skip to content

Not able to execute Delete command  #25756

@vamshicholleti93

Description

@vamshicholleti93

This is autogenerated. Please review and update as needed.

Describe the bug

Command Name
az aro delete

Errors:

The command failed with an unexpected error. Here is the traceback:
'GraphError' object has no attribute 'message'
Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/role/_msgrpah/_graph_client.py", line 52, in _send
    r = send_raw_request(self._cli_ctx, method, url, resource=self._resource, uri_parameters=param,
  File "/usr/local/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/core/util.py", line 1016, in send_raw_request
    raise HTTPError(reason, r)
azure.cli.core.azclierror.HTTPError: Forbidden({"error":{"code":"Authorization_RequestDenied","message":"Insufficient privileges to complete the operation.","innerError":{"date":"2023-03-10T21:54:50","request-id":"3bb0f4ab-4281-4e7d-8052-2ee2627c1976","client-request-id":"3bb0f4ab-4281-4e7d-8052-2ee2627c1976"}}})

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/aro/custom.py", line 168, in aro_delete
    rp_client_sp_id = aad.get_service_principal_id(resolve_rp_client_id())
  File "/usr/local/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/aro/_aad.py", line 31, in get_service_principal_id
    sps = self.client.service_principal_list(f"appId eq '{app_id}'")
  File "/usr/local/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/role/_msgrpah/_graph_client.py", line 179, in service_principal_list
    result = self._send("GET", "/servicePrincipals" + _filter_to_query(filter))
  File "/usr/local/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/role/_msgrpah/_graph_client.py", line 55, in _send
    raise GraphError(ex.response.json()['error']['message'], ex.response) from ex
azure.cli.command_modules.role._msgrpah._graph_client.GraphError: Insufficient privileges to complete the operation.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/knack/cli.py", line 233, in invoke
    cmd_result = self.invocation.execute(args)
  File "/usr/local/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 663, in execute
    raise ex
  File "/usr/local/Cellar/azure-cli/2.43.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 "/usr/local/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 697, in _run_job
    result = cmd_copy(params)
  File "/usr/local/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/__init__.py", line 333, in __call__
    return self.handler(*args, **kwargs)
  File "/usr/local/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/core/commands/command_operation.py", line 121, in handler
    return op(**command_args)
  File "/usr/local/Cellar/azure-cli/2.43.0/libexec/lib/python3.10/site-packages/azure/cli/command_modules/aro/custom.py", line 172, in aro_delete
    logger.info(e.message)
AttributeError: 'GraphError' object has no attribute 'message'

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 aro delete --resource-group {} --name {} --yes

Expected Behavior

Environment Summary

macOS-12.6-x86_64-i386-64bit, Darwin 21.6.0
Python 3.10.9
Installer: HOMEBREW

azure-cli 2.43.0

Additional Context

Metadata

Metadata

Assignees

No one assigned

    Labels

    AROaz aro (Azure Redhat OpenShift)Service AttentionThis issue is responsible by Azure service team.act-codegen-extensibility-squadbugThis issue requires a change to an existing behavior in the product in order to be resolved.customer-reportedIssues that are reported by GitHub users external to the Azure organization.needs-team-attentionThis issue needs attention from Azure service team or SDK team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions