BUG in Azure Arc connected Kuberentes and App Service

Gábor Szabó 5 Reputation points
2024-08-09T14:56:19.45+00:00

Hi,

I had a test environment where I deployed my own Kubernetes cluster, connected it with Azure Arc, deployed the AppService extension and created an AppService on it. Everything worked nicely.

When I finished my work, I simply deleted the resource group and my "App Service Kubernetes Environment" resource stuck there. The error message says: "Failed to delete Kubernetes environment <NAME>: The specified kube environment <NAME> cannot be deleted because it still contains resources."

Of course there are not AppServices attached to this resource and the K8s cluster's extension is also detached. No Apps and neither no App Service plans attached to the resource. So it is empty.

In the JSON, the extededLocation still refers to the custom location what I created but that is already deleted when I triggered the whole resource group deletion.

I tried to delete the resource via Azure CLI (az resource delete) as well and I got the same error message.

This happened with me second time. First time I rebuilt the components and I deleted manually in the right order. So that will be the workaround here as well.

I guess this is a bug as it didn't keep the dependency order during deletion. I wanted to report this it via the support channel but MS asks money for that hence I drop it here. Maybe a relevant person can translate it to the right place :)

Azure Arc
Azure Arc
A Microsoft cloud service that enables deployment of Azure services across hybrid and multicloud environments.
402 questions
Azure App Service
Azure App Service
Azure App Service is a service used to create and deploy scalable, mission-critical web apps.
7,663 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Ryan Hill 27,771 Reputation points Microsoft Employee
    2024-09-02T01:08:16.8766667+00:00

    Hi @Gábor Szabó

    Thank you for sharing your repro steps and working offline with us. the issue has been resolved. Essentially what happened is that farm/website resources that were created in the kubeEnvironment were left over in reference sources. Those resources have been removed and the environment can be deleted. According to logs, it was resources from a while ago.

    Rather than deleting the resource group, delete the resources created in the kubeEnvironment first then delete the cluster. I also suggest using Container Apps on Azure Arc Overview | Microsoft Learn rather than using app service on Arc.


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.