Resource Provider Not Registered Errors in Azure
When you try to create an Azure resource and receive “The subscription is not registered to use namespace,” the resource provider for that service has not been registered in your subscription. This page explains what resource providers are, how to register them, and how to automate registration for new subscriptions.
What resource providers are and why they need registration
Every Azure service is exposed through a resource provider — a namespace that groups related resource types. For example, Microsoft.Compute provides virtual machines and disks, while Microsoft.ContainerService provides AKS clusters.
The full error message looks like this:
The subscription is not registered to use namespace 'Microsoft.ContainerService'.
See https://aka.ms/rps-not-found for how to register subscriptions.Or in a Terraform deployment:
Error: compute.VirtualMachinesClient#CreateOrUpdate: Failure sending request:
StatusCode=409 -- Original Error: Code="MissingSubscriptionRegistration"
Message="The subscription is not registered to use namespace
'Microsoft.Compute'. See https://aka.ms/rps-not-found for how to register
subscriptions."Registration is required because Azure tracks which services a subscription has agreed to use. Some providers auto-register when you use the portal (the portal registers on your behalf), but CLI, Terraform, ARM templates, and SDKs do not auto-register — they fail if the provider is not already registered.
Some commonly used providers like Microsoft.Resources and Microsoft.Authorization are registered automatically for all subscriptions. Others, especially newer services or preview features, require explicit registration.
Checking registration status
List all providers and their registration status:
az provider list --output tableFilter to see only unregistered providers:
az provider list \
--query "[?registrationState=='NotRegistered'].{Namespace: namespace, State: registrationState}" \
--output tableCheck the status of a specific provider:
az provider show \
--namespace Microsoft.ContainerService \
--query "{namespace: namespace, state: registrationState}" \
--output jsonOutput when not registered:
{
"namespace": "Microsoft.ContainerService",
"state": "NotRegistered"
}Output when registered:
{
"namespace": "Microsoft.ContainerService",
"state": "Registered"
}
</section>
<section class="content-section" aria-labelledby="rp-register">
<h2 id="rp-register">Registering a resource provider</h2>
Register a single provider:
```bash
az provider register --namespace Microsoft.ContainerServiceRegistration is asynchronous. Poll until it completes:
# Poll every 10 seconds until Registered
while true; do
STATE=$(az provider show \
--namespace Microsoft.ContainerService \
--query registrationState -o tsv)
echo "$(date): $STATE"
if [ "$STATE" = "Registered" ]; then
echo "Registration complete."
break
fi
sleep 10
doneRegister multiple providers commonly needed for a full Azure environment:
PROVIDERS=(
"Microsoft.Compute"
"Microsoft.ContainerService"
"Microsoft.ContainerRegistry"
"Microsoft.DBforPostgreSQL"
"Microsoft.DBforMySQL"
"Microsoft.DocumentDB"
"Microsoft.EventHub"
"Microsoft.KeyVault"
"Microsoft.ManagedIdentity"
"Microsoft.Network"
"Microsoft.OperationalInsights"
"Microsoft.ServiceBus"
"Microsoft.Sql"
"Microsoft.Storage"
"Microsoft.Web"
"Microsoft.Cache"
"Microsoft.Cdn"
"Microsoft.Logic"
"Microsoft.ApiManagement"
"Microsoft.Search"
)
for PROVIDER in "${PROVIDERS[@]}"; do
echo "Registering $PROVIDER..."
az provider register --namespace "$PROVIDER" --wait
echo "$PROVIDER: $(az provider show --namespace $PROVIDER --query registrationState -o tsv)"
doneThe --wait flag blocks until registration completes for each provider before moving to the next.
Commonly needed providers by workload type
Different workload types require different providers. Below are the most commonly missing ones grouped by scenario.
Container and Kubernetes workloads:
az provider register --namespace Microsoft.ContainerService # AKS
az provider register --namespace Microsoft.ContainerRegistry # ACR
az provider register --namespace Microsoft.ContainerInstance # ACIData and analytics workloads:
az provider register --namespace Microsoft.Sql # Azure SQL
az provider register --namespace Microsoft.DocumentDB # Cosmos DB
az provider register --namespace Microsoft.Synapse # Synapse Analytics
az provider register --namespace Microsoft.DataFactory # Data Factory
az provider register --namespace Microsoft.EventHub # Event Hubs
az provider register --namespace Microsoft.StreamAnalytics # Stream AnalyticsMonitoring and observability:
az provider register --namespace Microsoft.OperationalInsights # Log Analytics
az provider register --namespace Microsoft.Insights # Azure Monitor
az provider register --namespace Microsoft.AlertsManagement # AlertsSecurity and identity:
az provider register --namespace Microsoft.KeyVault # Key Vault
az provider register --namespace Microsoft.ManagedIdentity # Managed Identities
az provider register --namespace Microsoft.Security # Defender for CloudAutomating registration in Terraform
Terraform’s azurerm provider can register resource providers automatically if skip_provider_registration = false (the default). However, this requires the service principal to have the registration permission, and it only registers providers that Terraform resources directly use.
For more control, use the azurerm_resource_provider_registration resource:
resource "azurerm_resource_provider_registration" "container_service" {
name = "Microsoft.ContainerService"
}
resource "azurerm_resource_provider_registration" "container_registry" {
name = "Microsoft.ContainerRegistry"
}
resource "azurerm_kubernetes_cluster" "main" {
# ... AKS configuration ...
depends_on = [
azurerm_resource_provider_registration.container_service
]
}The depends_on ensures provider registration completes before Terraform attempts to create the AKS cluster.
Alternatively, disable Terraform’s automatic registration and manage it separately:
provider "azurerm" {
features {}
skip_provider_registration = true
}With skip_provider_registration = true, Terraform will not attempt to register any providers and will fail immediately if the required provider is not already registered. This is useful when the Terraform service principal does not have registration permissions and you want to manage registration through a separate process.
For new subscriptions, run the bulk registration script as part of your subscription onboarding automation before any Terraform deployments run. This avoids registration failures mid-deployment and eliminates the need for the Terraform service principal to have registration permissions.
Unregistering providers
You can unregister providers that are no longer needed, though this is rarely done in practice:
az provider unregister --namespace Microsoft.ContainerServiceUnregistering a provider while resources of that type still exist in the subscription will cause management plane operations on those resources to fail. Azure will warn you but allow the unregistration. Only unregister providers when all resources of that type have been deleted from the subscription.
Common mistakes
- Assuming portal registration carries over to new subscriptions. Resource provider registration is per-subscription. Creating a new subscription for a new environment means all providers start unregistered, even if the same providers are registered in the organization’s existing subscriptions.
- Not waiting for registration to complete before deploying. Running
az provider registerand immediately runningterraform applywill still fail because registration takes minutes. Use—waitor poll the registration state before proceeding. - Using Reader role for a service principal that needs to register providers. Reader does not include registration permissions. The service principal running Terraform or deployment scripts needs at least Contributor to register resource providers.
- Forgetting Microsoft.OperationalInsights when deploying AKS with monitoring. AKS with Container Insights enabled requires both
Microsoft.ContainerServiceandMicrosoft.OperationalInsights. Forgetting the Log Analytics provider causes the AKS deployment to fail at the monitoring configuration step, not at the cluster creation step.
Summary
- ”The subscription is not registered to use namespace” means you need to run
az provider register —namespace <name>before creating the resource. - Registration is per-subscription — every new subscription starts with most providers unregistered.
- Registration is asynchronous and takes up to 15 minutes; use
—waitor poll the state before retrying. - For new subscriptions, run a bulk registration script as part of onboarding to avoid mid-deployment failures.
Frequently asked questions
Why does resource provider registration fail with "Authorization failed"?
Registering a resource provider requires the Microsoft.Support/register/action permission, which is part of the Contributor and Owner roles. Reader role does not include registration permissions. Assign at least Contributor to the user or service principal attempting the registration.
How long does resource provider registration take?
Most registrations complete in under 5 minutes. A few providers (notably Microsoft.Cdn and Microsoft.ContainerService) can take up to 10–15 minutes. Poll the status with az provider show --namespace Microsoft.Compute --query registrationState until it shows "Registered".
Do I need to register providers in every subscription?
Yes. Resource provider registration is per-subscription. A provider registered in subscription A is not automatically registered in subscription B. In multi-subscription environments, automate registration with a script or Terraform resource as part of subscription onboarding.