Microsoft.ContainerService/CapacityReservationGroupPreview not listed under preview features?

Benjamin Hammond 21 Reputation points Microsoft Employee
2022-10-20T13:08:11.527+00:00

I am trying to create an AKS cluster on a capacity reservation using Terraform and I am hitting the following error:

Error: creating Cluster: (Managed Cluster Name "imf-ci-1679679-aks-k8s" / Resource Group "imf-ci-1679679-aks-rg"): containerservice.ManagedClustersClient#CreateOrUpdate: Failure sending request: StatusCode=400 -- Original Error: Code="PreviewFeatureNotRegistered" Message="Preview feature Microsoft.ContainerService/CapacityReservationGroupPreview not registered."  

This is after successfully creating a capacity reservation. The error seems reasonably clear as to what the problem is; that Microsoft.ContainerService/CapacityReservationGroupPreview is a Preview Feature that hasn't been registered in the subscription in question, so I went to register it and could not find it in the list of Preview features. This confused me for a bit so I did some searching and found https://learn.microsoft.com/en-us/answers/questions/947870/i-can39t-find-feature-microsoftcontainerserviceaks.html which referred to a different feature but said that that feature was only available in 1st Party Microsoft subscriptions. I thought that's not ideal, but I work for Microsoft I can have a look on my Microsoft account! And yet when I did that on a few different subscriptions within the Microsoft tenant I still couldn't find it.

Where is this feature? Am I looking in the wrong place? Is it called something obscure that I am missing? Is it in some very private preview? Or is the error misleading and I've been going down completely the wrong track?

The Terraform I am using looks like:

resource "azurerm_capacity_reservation_group" "main_capacity_group" {  
  name                = "${var.si}-reservation-group"  
  resource_group_name = var.resource_group.name  
  location            = var.region  
  tags                = var.tags  
}  
  
resource "azurerm_capacity_reservation" "main_capacity" {  
  name                          = "${var.si}-reservation"  
  capacity_reservation_group_id = azurerm_capacity_reservation_group.main_capacity_group.id  
  sku {  
    name     = var.aks_vm.vm_size  
    capacity = var.aks_vm.vm_count  
  }  
  tags = var.tags  
}  
  
resource "azurerm_kubernetes_cluster" "main" {  
  name                    = "${var.si}-k8s"  
  tags                    = var.tags  
  resource_group_name     = var.resource_group.name  
  node_resource_group     = "${var.resource_group.name}-mc-rg"  
  location                = var.region  
  dns_prefix              = "${var.si}-k8s"  
  kubernetes_version      = var.kubernetes_version  
  disk_encryption_set_id  = one(module.cmk_des[*].des.id)  
  private_cluster_enabled = var.private_cluster_enabled  
  sku_tier                = "Paid"  
  
  default_node_pool {  
    name                = "nodepool"  
    enable_auto_scaling = var.cluster_autoscaler != null  
    min_count           = var.cluster_autoscaler != null ? var.aks_vm.vm_count : null  
    max_count           = one(var.cluster_autoscaler[*].max_node_count)  
    name                          = "nodepool"  
    capacity_reservation_group_id = azurerm_capacity_reservation_group.main_capacity_group.id  
    enable_auto_scaling           = var.cluster_autoscaler != null  
    min_count                     = var.cluster_autoscaler != null ? var.aks_vm.vm_count : null  
    max_count                     = one(var.cluster_autoscaler[*].max_node_count)  
    node_count      = var.cluster_autoscaler != null ? null : var.aks_vm.vm_count  
    vm_size         = var.aks_vm.vm_size  
    os_disk_size_gb = 200  
    max_pods        = var.max_pods  
    vnet_subnet_id  = data.azurerm_subnet.subnet_pod.id  
    zones           = var.availability_zone[*]  
    tags            = var.tags  
  }  
...  
}  
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.
1,931 questions
0 comments No comments
{count} votes

Accepted answer
  1. Jorge Palma 76 Reputation points Microsoft Employee
    2022-10-20T17:54:35.743+00:00

    This is not a 1P feature, as a rule of thumb AKS doesn't have 1P features. The other feature linked was just not available publicly yet, this one already is. :)

    I can see the feature flag fine, do you have the output of this on your side?

    252622-image.png


1 additional answer

Sort by: Most helpful
  1. Jorge Palma 76 Reputation points Microsoft Employee
    2022-10-21T19:39:20.833+00:00

    Makes sense. The portal list only includes previews that are/were available in the portal. Most features arrive in portal at GA (like this one).

    0 comments No comments