Azure "The subscription is not registered to use namespace": register the resource provider
Fix Azure "(MissingSubscriptionRegistration) The subscription is not registered to use namespace": register the resource provider with az CLI, PowerShell or Terraform.
by OhSudo ·
(MissingSubscriptionRegistration) The subscription is not registered to use namespace 'Microsoft.ContainerService'. See https://aka.ms/rps-not-found for how to register subscriptions.Code: MissingSubscriptionRegistrationEach Azure service is offered by a resource provider, named like Microsoft.ContainerService for AKS, or Microsoft.Web for App Service. A subscription has to be registered for a provider before it can create its resources. New subscriptions have only some registered, so the first time you use a service, you meet this.
It’s a one-time step per subscription, and the message names exactly which provider.
TL;DR
az provider register --namespace Microsoft.ContainerService --waitaz provider show --namespace Microsoft.ContainerService --query registrationState -o tsvWhen it says Registered, run your deployment again.
1. Register it
With the Azure CLI:
az account show --query name -o tsvaz provider register --namespace Microsoft.ContainerService --waitCheck you’re on the right subscription first, with the first line. --wait blocks until registration finishes, which can take a few minutes. Without it, the command returns at once, and the state stays Registering for a while.
With PowerShell:
Register-AzResourceProvider -ProviderNamespace Microsoft.ContainerServiceGet-AzResourceProvider -ProviderNamespace Microsoft.ContainerService | Select-Object ProviderNamespace, RegistrationStateIn the portal: Subscriptions → your subscription → Resource providers, search for the name, and Register.
2. Which providers you have
az provider list --query "[?registrationState=='Registered'].namespace" -o tsvCommon ones you may need to register, for the services they belong to:
| Provider | For |
|---|---|
Microsoft.ContainerService |
AKS |
Microsoft.ContainerInstance |
Container Instances |
Microsoft.Web |
App Service, Functions |
Microsoft.OperationalInsights |
Log Analytics |
Microsoft.Insights |
Monitor, diagnostics |
Microsoft.KeyVault |
Key Vault |
Microsoft.DBforPostgreSQL |
Azure Database for PostgreSQL |
A service may use several providers. AKS with monitoring needs Microsoft.OperationalInsights too, so a second, similar error can follow the first.
3. Rights to register
Registering needs the */register/action permission on the subscription, which Contributor and Owner have. Without it, you get an authorization error instead:
(AuthorizationFailed) The client 'ci-deployer' with object id '...' does not have authorization to perform action 'Microsoft.ContainerService/register/action' over scope '/subscriptions/...'Ask a subscription owner to register the provider once, or grant this action to your pipeline’s identity. If the sign-in itself fails, before any of this, see Azure AADSTS errors.
4. Terraform
The azurerm provider can register providers itself. Since version 4, the resource_provider_registrations setting controls which:
provider "azurerm" { features {} resource_provider_registrations = "core"}"core" is the default set, "extended" and "all" register more, and "none" registers none, for identities without rights to register. To register one more, list it with resource_providers_to_register, or create an azurerm_resource_provider_registration resource. In version 3 the older setting was skip_provider_registration.
Bicep and ARM templates don’t register providers. Run the CLI command once, or add it to your pipeline before the deployment.
Warning
Don’t give a pipeline Owner on the subscription just to register providers. Register them once with an admin account, or grant only the register/action rights the pipeline needs. Registration has no cost by itself, so registering a provider you end up not using is harmless.
Shell, we have a problem!
Similar, but different: AuthorizationFailed means you lack a permission, as in section 3. SkuNotAvailable means that size isn’t offered in that region, or for your subscription. QuotaExceeded means you’ve hit a limit, such as vCPUs per region, and need to request more. On AWS, a refused action is not authorized to perform.
Found this useful? Share it.
Found a mistake? Let us know at contact@ohsudo.com.