Unable to Delete Azure SCOM Managed Instance Due to Internal Error

Oversight Operations 20 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 Monitor
Azure Monitor
An Azure service that is used to collect, analyze, and act on telemetry data from Azure and on-premises environments.
3,584 questions
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.
167 questions
{count} votes

Accepted answer
  1. SadiqhAhmed-MSFT 48,726 Reputation points Microsoft Employee
    2025-04-22T16:03:19.2166667+00:00

    @Oversight Operations FYI!

    @David V Dellanno There is not really a cli command for this. Check if you still have a resource group that starts with MC_ followed by something that resembles your SCOM MI resource group. If that doesn't exist you have to recreate it. Just an empty resource group is enough and then try to delete your SCOM MI instance again. 

    If that resource group still exists with resources in it, I recommend following the procedure below:

    Step1: Use the following action plan to delete the orphaned SCOM managed instances:

    • Create a new empty resource group with the name "MC_<SCOM_MI_ResourceGroup_Name>_<SCOM_MI_Instance_Name>" for example "MC_ManagedInstances_scomlpatj"
    • Navigate to the orphaned SCOM managed instance, select the "Delete" option at the top, and proceed with the deletion.

    Step2: If the above step will not resolve the issue, it may be due to lack of permission to read the "MC" managed resource groups. To resolve this, grant the "Microsoft.SCOM" resource provider "Reader" permission on each “MC” resource group, or alternatively, at the subscription level, and then test the deletion again.

    At Resource Group level:

    • Go to Azure Portal → Resource Groups.
    • Select the correct "MC" resource group.
    • Navigate to Access Control (IAM).
    • Click Add role assignment.
    • In the Role tab, select Reader.
    • In the Members tab:
    • Select User, Group, or Service Principal
    • +Select members search for "Microsoft.SCOM" and click on Select
    • Click Next and then Review + Assign.

    At Subscription Level:

    • Go to Azure Portal → Subscriptions.
    • Select your subscription
    • Navigate to Access Control (IAM).
    • Click Add role assignment.
    • In the Role tab, select Reader.
    • In the Members tab:
    • Select User, Group, or Service Principal
    • +Select members search for "Microsoft.SCOM" and click on Select
    • Click Next and then Review + Assign.

    Step3: If the above step will not resolve the issue, it may be due to lack of permission to delete the "MC" managed resource groups. To resolve this, follow the steps below to grant the necessary permission. Then try to delete the corresponding SCOM MI instance.

    1. Go to Azure Role Definitions:
    2. Navigate to Subscriptions in Azure Portal.
    3. Select your subscription.
    4. Click Access Control (IAM) → Roles.
    5. Click + Add → Add a custom role.
    6. Define the Custom Role:
    7. Give it a name (e.g., SCOM MI Deletion).
    8. Under Permissions, click + Add permissions.
    9. Search for Microsoft.Resources/subscriptions/resourceGroups/delete and select it.
    10. Click Next.
    11. Assign Custom Role to Microsoft.SCOM:
    12. Go to the "MC" managed Resource Group.
    13. Under Access Control (IAM) → Add role assignment.
    14. Select the new custom role (SCOM MI Deletion)
    15. Assign it to Microsoft.SCOM Step1:
      Use the following action plan to delete the orphaned SCOM managed instances:
      • Create a new empty resource group with the name "MC_<SCOM_MI_ResourceGroup_Name>_<SCOM_MI_Instance_Name>" for example "MC_ManagedInstances_scomlpatj"
      • Navigate to the orphaned SCOM managed instance, select the "Delete" option at the top, and proceed with the deletion.
      Step2:
      If the above step will not resolve the issue, it may be due to lack of permission to read the "MC" managed resource groups.
      To resolve this, grant the "Microsoft.SCOM" resource provider "Reader" permission on each “MC” resource group, or alternatively, at the subscription level, and then test the deletion again. At Resource Group level:
      • Go to Azure Portal → Resource Groups.
      • Select the correct "MC" resource group.
      • Navigate to Access Control (IAM).
      • Click Add role assignment.
      • In the Role tab, select Reader.
      • In the Members tab:
      • Select User, Group, or Service Principal
      • +Select members search for "Microsoft.SCOM" and click on Select
      • Click Next and then Review + Assign.
      At Subscription Level:
      • Go to Azure Portal → Subscriptions.
      • Select your subscription
      • Navigate to Access Control (IAM).
      • Click Add role assignment.
      • In the Role tab, select Reader.
      • In the Members tab:
      • Select User, Group, or Service Principal
      • +Select members search for "Microsoft.SCOM" and click on Select
      • Click Next and then Review + Assign.
      Step3:
      If the above step will not resolve the issue, it may be due to lack of permission to delete the "MC" managed resource groups.
      To resolve this, follow the steps below to grant the necessary permission. Then try to delete the corresponding SCOM MI instance.
      1. Go to Azure Role Definitions:
      2. Navigate to Subscriptions in Azure Portal.
      3. Select your subscription.
      4. Click Access Control (IAM) → Roles.
      5. Click + Add → Add a custom role.
      6. Define the Custom Role:
      7. Give it a name (e.g., SCOM MI Deletion).
      8. Under Permissions, click + Add permissions.
      9. Search for Microsoft.Resources/subscriptions/resourceGroups/delete and select it.
      10. Click Next.
      11. Assign Custom Role to Microsoft.SCOM:
      12. Go to the "MC" managed Resource Group.
      13. Under Access Control (IAM) → Add role assignment.
      14. Select the new custom role (SCOM MI Deletion)
      15. Assign it to Microsoft.SCOM

    Hope this helps. Let us know how it goes!


    If the response helped, do "Accept Answer" and up-vote it

    1 person found this answer helpful.
    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Madugula Jahnavi 490 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.


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.