Fix Azure 'SubscriptionNotRegistered' Error
The Error: "SubscriptionNotRegistered"
You try to create an Azure resource and get:
The subscription is not registered to use namespace 'Microsoft.Compute'.
See https://aka.ms/rps-not-found for how to register subscriptions.
Or in Terraform:
Error: creating Virtual Machine: compute.VirtualMachinesClient#CreateOrUpdate:
The subscription is not registered to use namespace 'Microsoft.Compute'
The resource type doesn't matter -- this error appears for Compute, Storage, Network, ContainerService, and any other Azure resource provider.
Root Cause
Azure uses resource providers to supply functionality for each service. Before you can create resources of a specific type, the corresponding provider must be registered on your subscription. New subscriptions only have a handful of providers registered by default. If you try to use a service whose provider isn't registered, Azure blocks the request.
Common providers that trip people up:
Microsoft.Compute-- VMs, disksMicrosoft.ContainerService-- AKSMicrosoft.KeyVault-- Key VaultMicrosoft.OperationalInsights-- Log AnalyticsMicrosoft.ContainerRegistry-- ACRMicrosoft.DBforPostgreSQL-- PostgreSQL
Step-by-Step Fix
1. Identify Which Provider Is Missing
The error message tells you exactly which namespace is needed. Extract it from the error:
namespace 'Microsoft.Compute'
2. Check Current Registration Status
az provider show --namespace Microsoft.Compute --query "registrationState" -o tsv
If the output is NotRegistered or Unregistered, that's your problem.
3. Register the Provider
az provider register --namespace Microsoft.Compute
Registration is asynchronous. It typically takes 1-3 minutes.
4. Wait for Registration to Complete
# Poll until registered
az provider show --namespace Microsoft.Compute --query "registrationState" -o tsv
Keep checking until it returns Registered. Or use a watch loop:
watch -n 10 'az provider show --namespace Microsoft.Compute --query "registrationState" -o tsv'
5. Register Multiple Providers at Once
If you're setting up a new subscription, register all commonly needed providers:
providers=(
Microsoft.Compute
Microsoft.Storage
Microsoft.Network
Microsoft.ContainerService
Microsoft.KeyVault
Microsoft.ContainerRegistry
Microsoft.OperationalInsights
Microsoft.ManagedIdentity
Microsoft.Authorization
Microsoft.Monitor
Microsoft.DBforPostgreSQL
)
for provider in "${providers[@]}"; do
echo "Registering $provider..."
az provider register --namespace "$provider" --wait
done
6. Verify and Retry
After registration completes, retry the original operation:
# Verify
az provider show --namespace Microsoft.Compute --query "registrationState" -o tsv
# Output: Registered
# Retry your deployment
az vm create --resource-group myRG --name myVM --image Ubuntu2204 ...
7. Handle Permission Issues
If you get an authorization error when registering:
The client does not have authorization to perform action
'Microsoft.Compute/register/action' on scope '/subscriptions/...'
You need the Contributor or Owner role on the subscription, or a custom role with */register/action permission. Ask your subscription admin to either:
# Grant you the ability to register providers
az role assignment create \
--assignee [email protected] \
--role "Contributor" \
--scope "/subscriptions/YOUR_SUBSCRIPTION_ID"
Or have them register the provider for you.
Fix in Terraform
If you use Terraform, you can auto-register providers in the AzureRM provider block:
provider "azurerm" {
features {}
resource_provider_registrations = "extended"
}
This registers common providers automatically during terraform apply.
Prevention Tips
- Register providers during subscription setup. Include provider registration in your subscription vending automation.
- Use Terraform's
resource_provider_registrationsto handle this declaratively. - List all registered providers periodically:
az provider list --query "[?registrationState=='Registered'].namespace" -o tsv. - Use Azure Policy to enforce that required providers are always registered on subscriptions.
- Document required providers in your IaC repository README so new team members know what's needed.
Was this article helpful?
Related Articles
Azure Blob Storage 403 AuthorizationPermissionMismatch: Step-by-Step Fix Guide
If you've ever stared at this error message in your logs, you know the frustration: It's one of those errors that looks simple on the surface but has about...
Azure AKS: Production-Ready Cluster Setup in 15 Minutes
Stand up a production-grade AKS cluster with autoscaling, RBAC, monitoring, and private networking in under 15 minutes.
Azure AKS: Production Kubernetes Cluster Setup and Configuration
Deploy a production AKS cluster on Azure — node pools, managed identities, Azure CNI, RBAC integration with Entra ID, ACR integration, autoscaling, monitoring with Azure Monitor, and Terraform setup.
Azure DevOps Pipelines: YAML CI/CD from Build to Production
How to build production Azure DevOps YAML pipelines — multi-stage CI/CD, environments, approvals, variable groups, templates, container jobs, and deployment strategies for Kubernetes and App Service.
Azure DevOps Pipelines: YAML Templates and Best Practices
Master Azure DevOps YAML pipelines with reusable templates, environment approvals, and multi-stage deployments.
Azure Core Services: The DevOps Engineer's Essential Guide
Understand Azure's essential services — VMs, Storage, VNets, Azure AD (Entra ID), AKS, App Service, and Azure DevOps for infrastructure automation.