Deleted my azure monitor workspace on my kubernetes cluster!

Aaron Taylor 0 Reputation points
2025-01-27T16:34:53.8933333+00:00

A week ago I deleted my azure monitor workspace on my kubernetes cluster. Why can I still not link my kubernetes cluster to another workspace? It prompts me to enable managed prometheus in my insights but I get an error saying I don't not have access to the azure monitor workspace or it has been deleted. How do I configure my cluster to send data to a new workspace I've created? Will I have to recreate my whole cluster?

Azure Kubernetes Service (AKS)
Azure Kubernetes Service (AKS)
An Azure service that provides serverless Kubernetes, an integrated continuous integration and continuous delivery experience, and enterprise-grade security and governance.
2,239 questions
{count} votes

1 answer

Sort by: Most helpful
  1. anashetty 1,955 Reputation points Microsoft Vendor
    2025-01-29T22:35:12.97+00:00

    Hi Aaron Taylor,

    Thank you for getting back with us. Could you please try below troubleshooting steps, I have tried from my end it is working for me.

    First check that if old workspace is still linked with the cluster.

    az aks show --resource-group <resource-group> --name <cluster-name> --query addonProfiles
    

    User's image

    Now remove the Monitoring Add-on, wait for some time.

    az aks disable-addons -a monitoring --resource-group <resource-group> --name <cluster-name>
    

    User's image

    User's image

    You can see that default workspace is removed. Now attach the new workspace.

    Get the new workspace ID and then Re-enable monitoring with the new workspace.

    az monitor log-analytics workspace show --resource-group <resource-group> --workspace-name <new-workspace> --query id
    
    az aks enable-addons --resource-group <resource-group> --name <cluster-name> --addons monitoring --workspace-resource-id /subscriptions/xxxx-xxxx-xxxx/resourceGroups/<resource-group>/providers/Microsoft.OperationalInsights/workspaces/<new-workspace>
    

    User's image You can see that new workspace is attached to the AKS cluster. Check if Managed Prometheus is enabled for the new workspace and that AKS is configured to send metrics there.

    If you have further queries, please do let me know. If this solution answers your query, please click Upvote and Accept Answer as it will be useful to others who face the same issue.

    User's image

    0 comments No comments

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.