Unable to Delete Azure SCOM Managed Instance Due to Internal Error

Oversight Operations 0 Reputation points
2025-03-11T00:41:01.65+00:00

I successfully installed SCOM Managed Instance (MI) in Azure. However, when it was time to delete multiple resource groups supporting this project, I did not perform the deletions in the correct order. This may have caused the SCOM MI to generate an internal error, when cleaning up.

Steps Taken:

Attempted to force deletion of the resource using Cloud Shell.

  1. Deployed the resource with --complete using a empty template.json file to remove the SCOM MI.
  2. Validated the deletion of the resource group, but there is no force checkbox to perform the deletion.

Issue: Despite these efforts, the SCOM MI continues to generate an internal error, and I am unable to delete the SCOM MI resource and its resource groups.

Request: I need assistance in resolving this issue and successfully deleting the resource groups and SCOM MI.

Azure Managed Applications
Azure Managed Applications
An Azure service that enables managed service providers, independent software vendors, and enterprise IT teams to deliver turnkey solutions through the Azure Marketplace or service catalog.
163 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Madugula Jahnavi 10 Reputation points Microsoft External Staff
    2025-03-13T11:26:53.7966667+00:00

    Firstly, you can delete an instance directly from the overview of SCOM or you can visit the resource group and check the location of SCOM, delete it from there.

    After deleting the instance, you will also need to remove the two databases created in SQL MI. In the resource view, locate and select both databases (based on the name assigned to your SCOM Managed Instance) and click on Delete. The same procedure is clearly detailed in the MS Doc.

    If still the issue persists, you can try using Az CLI az resource delete command as shown below.

    az resource delete --ids "Resource ID of SCOM MI"
    

    Also, check if there are any resource locks that is disrupting the SCOM MI resource deletion.

    Hope this helps.

    If the answer is helpful, please click Accept Answer and kindly upvote it. If you have any further questions about this answer, please click Comment.

    0 comments No comments

  2. Oversight Operations 0 Reputation points
    2025-03-13T16:03:16.33+00:00

    Here is the command to run with error:

    az resource delete --ids "/subscriptions/subid/resourceGroups/rg-lab-dev-manageops-scommi/providers/Microsoft.Scom/managedInstances/MGLAB" --debug >> result.txt

    result.txt:

    DEBUG: cli.azure.cli.core.sdk.policies: Response content:

    DEBUG: cli.azure.cli.core.sdk.policies: {"id":"/providers/Microsoft.Scom/locations/EASTUS2/operationStatuses/a5379cb6-d747-46b6-ba7d-4b5bc4d38c321D7A97F71411DD2EFCD6E477DFE627964E76865D7D97CB235C8D9635393EF14A","name":"a5379cb6-d747-46b6-ba7d-4b5bc4d38c321D7A97F71411DD2EFCD6E477DFE627964E76865D7D97CB235C8D9635393EF14A","resourceId":"/subscriptions/subid/resourceGroups/rg-lab-dev-manageops-scommi/providers/Microsoft.Scom/managedInstances/MGLAB","status":"Failed","startTime":"2025-03-13T15:55:26.7687886Z","endTime":"2025-03-13T15:55:28.3516655Z","error":{"code":"UnhandledException","message":"An internal error occurred during execution.[]"}}

    DEBUG: cli.azure.cli.core.azclierror: Traceback (most recent call last):

    File "/usr/lib64/az/lib/python3.9/site-packages/azure/core/polling/base_polling.py", line 757, in run

    self._poll()
    

    File "/usr/lib64/az/lib/python3.9/site-packages/azure/core/polling/base_polling.py", line 789, in _poll

    raise OperationFailed("Operation failed or canceled")
    

    azure.core.polling.base_polling.OperationFailed: Operation failed or canceled

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

    Traceback (most recent call last):

    File "/usr/lib64/az/lib/python3.9/site-packages/knack/cli.py", line 233, in invoke

    cmd_result = self.invocation.execute(args)
    

    File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 666, in execute

    raise ex
    

    File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 734, in _run_jobs_serially

    results.append(self._run_job(expanded_arg, cmd_copy))
    

    File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 703, in _run_job

    result = cmd_copy(params)
    

    File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/init.py", line 336, in call

    return self.handler(*args, **kwargs)
    

    File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/core/commands/command_operation.py", line 120, in handler

    return op(**command_args)
    

    File "/usr/lib64/az/lib/python3.9/site-packages/azure/cli/command_modules/resource/custom.py", line 2122, in delete_resource

    results.append(operation.result())
    

    File "/usr/lib64/az/lib/python3.9/site-packages/azure/core/polling/_poller.py", line 251, in result

    self.wait(timeout)
    

    File "/usr/lib64/az/lib/python3.9/site-packages/azure/core/tracing/decorator.py", line 94, in wrapper_use_tracer

    return func(*args, **kwargs)
    

    File "/usr/lib64/az/lib/python3.9/site-packages/azure/core/polling/_poller.py", line 270, in wait

    raise self._exception  # type: ignore
    

    File "/usr/lib64/az/lib/python3.9/site-packages/azure/core/polling/_poller.py", line 185, in _start

    self._polling_method.run()
    

    File "/usr/lib64/az/lib/python3.9/site-packages/azure/core/polling/base_polling.py", line 772, in run

    raise HttpResponseError(response=self._pipeline_response.http_response, error=err) from err
    

    azure.core.exceptions.HttpResponseError: (UnhandledException) An internal error occurred during execution.[]

    Code: UnhandledException

    Message: An internal error occurred during execution.[]

    ERROR: cli.azure.cli.core.azclierror: (UnhandledException) An internal error occurred during execution.[]

    Code: UnhandledException

    Message: An internal error occurred during execution.[]

    ERROR: az_command_data_logger: (UnhandledException) An internal error occurred during execution.[]

    Code: UnhandledException

    Message: An internal error occurred during execution.[]

    DEBUG: cli.knack.cli: Event: Cli.PostExecute [<function AzCliLogging.deinit_cmd_metadata_logging at 0x7f1e0a1d9dc0>]

    INFO: az_command_data_logger: exit code: 1

    INFO: cli.main: Command ran in 32.885 seconds (init: 0.187, invoke: 32.698)

    INFO: telemetry.main: Begin splitting cli events and extra events, total events: 1

    INFO: telemetry.client: Accumulated 0 events. Flush the clients.

    INFO: telemetry.main: Finish splitting cli events and extra events, cli events: 1

    INFO: telemetry.save: Save telemetry record of length 4193 in cache file under /home/david/.azure/telemetry/20250313155557550

    INFO: telemetry.main: Begin creating telemetry upload process.

    INFO: telemetry.process: Creating upload process: "/usr/bin/python3.9 /usr/lib/az/lib/python3.9/site-packages/azure/cli/telemetry/init.py /home/david/.azure /home/david/.azure/telemetry/20250313155557550"

    INFO: telemetry.process: Return from creating process 1085

    INFO: telemetry.main: Finish creating telemetry upload process.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.