Skip to content
Latchkey

Terraform AzureRM provider "MissingSubscriptionRegistration" (RP not registered) in CI

Azure rejected the call with MissingSubscriptionRegistration: the Azure Resource Provider namespace (for example Microsoft.ContainerService) is not registered on the subscription, so no resource of that type can be created.

What this error means

terraform apply fails with "MissingSubscriptionRegistration: The subscription is not registered to use namespace 'Microsoft.X'" or a "was not found" variant for the RP.

Terraform
Error: creating Kubernetes Cluster: containerservice.ManagedClustersClient
... Code="MissingSubscriptionRegistration" Message="The subscription is not
registered to use namespace 'Microsoft.ContainerService'. See
https://aka.ms/rps-not-found for how to register subscriptions."

Common causes

The resource provider was never registered

New subscriptions do not have every RP registered; the namespace for this resource type must be registered first.

AzureRM auto-registration is disabled or incomplete

If resource_provider_registrations is set to none, or registration is still propagating, the call fails until the RP is active.

How to fix it

Register the resource provider

  1. Read the namespace from the error message.
  2. Register it on the subscription and wait for it to report Registered.
  3. Re-run apply once registration completes.
Terminal
az provider register --namespace Microsoft.ContainerService
az provider show -n Microsoft.ContainerService \
  --query registrationState -o tsv

Let AzureRM register providers automatically

Allow the provider to register the namespaces it needs instead of disabling registration.

main.tf
provider "azurerm" {
  features {}
  resource_provider_registrations = "core"
}

How to prevent it

  • Register required RPs when provisioning a new subscription.
  • Leave AzureRM provider registration enabled unless you manage it elsewhere.
  • Wait for Registered state before applying resources of that type.

Related guides

Tired of flaky CI? Latchkey auto-heals failed jobs and retries them for you. Start free →