Terraform error deploying kubernetes since new azure defender container plan

│ Error: updating Cluster: (Managed Cluster Name “digitalplatform-cluster” / Resource Group “digitalplatform-prod”): containerservice.ManagedClustersClient#CreateOrUpdate: Failure sending request: StatusCode=400 – Original Error: Code=“AzureDefenderFeatureFlagNotEnabled” Message="AzureDefender installation is not allowed since feature ‘Microsoft.ContainerService/AKS-AzureDefender’ is not enabled. Please see Azure Kubernetes Service Roadmap (Public) · GitHub for how to enable features.

Error above even though it is enabled the terraform is ok works on other subscriptions - any thoughts ?

Creating a new AKS cluster in a new subscription requires AKS-AzureDefender feature registration · Issue #18395 · hashicorp/terraform-provider-azurerm · GitHub

this article helped us. We still dont know whats going on. We are going to engage MSFT and ask why they would update existing APIs like this and if its because they hate engineering teams.

note one of the commands is wrong. you want this instead:
az feature register --name AKS-AzureDefender --namespace Microsoft.ContainerService