Cannot delete log analytics workspace

Anki Mäntykivi 20 Reputation points

I tried to delete a log analytics workspace from Azure Portal and from Power Shell, but neither works.
From portal I get error:
Batch response item http error 409

Error details

managed-amiInworksFunctions-ws: <PII Removed>

From PS

Operation returned as invalid status code "Not found"

So I want to delete both log analytics workspace and the resource group. What can I do?

0 comments No comments

Sign in to comment

Answer accepted by question author

Edwin Cupido 80 Reputation points

Good day @Anki Mäntykivi

It is most likely one of these:

  • Application Insights resource (workspace-based)
  • Azure Function App / App Service using that Application Insights
  • ARM/Bicep deployment that created a “managed” monitoring setup

Steps:

  • Go to Application Insights (linked to that workspace)
  • Delete the Application Insights resource
  • Wait (Azure cleanup can take a few minutes)
  • The deny assignment will be removed automatically
  • Then delete:
    • Resource group OR
    • Workspace (if still present)

If you don't need anything inside the resource group:

Delete the main resource group that contains the Function/App Insights NOT the _managed one.

Azure will:

  • Remove dependent resources
  • Then remove the managed RG automatically
0 comments No comments

Sign in to comment

1 additional answer

  1. Anki Mäntykivi 20 Reputation points

    Thanks for your advice. I managed to delete the workspace now.

    1. Edwin Cupido 80 Reputation points

      Glad to hear it. Don't forget to mark it as Accepted which helps others know this was solved.


    Sign in to comment
Sign in to answer

Your answer