Menu

Virtual Geek

Tales from real IT system administrators world and non-production environment

MICROSOFT AZURE ERROR REGISTERING RESOURCE PROVIDERS CODE AUTHORIZATION FAILED

August 31, 2016 11:55AM

Recently I got new task on providing solution and architecting design for one of the project migration to Microsoft Azure.

Microsoft Azure is a cloud computing platform and infrastructure created by Microsoft for building, deploying, and managing applications and services through a global network of Microsoft-managed datacenters. It provides both PaaS and IaaS services and supports many different programming languages, tools and frameworks, including both Microsoft-specific and third-party software and systems. 

I wanted to create couple of VMs for some testing purpose to create VPN tunnel between in-house to Azure, While creating azure VMs I was keep receiving error as below. 

Error registering resource providers
DESCRIPTION Registering the resource providers has failed. Additional details from the underlying API that might be helpful: 'AuthorizationFailed' - The client kunaludapi@gmail.com with object id '1111111-111111-1111111111' does not have authorization to perform action 'Microsoft.Compute/register/action' over scope '/subscription/1111111-111111-1111111111'.(Code:AuthorizationFailed)
STATUS Error
TIME Friday, 26 August 2016, 15:43:30
CORRELATION IDS clientNotification-1111111-111111-1111111111
RESOURCE Test01 (resource group)

Microsoft Azure Error registering resource providers authorization failed

I checked my authorization and privileges everything was good I had assigned contributor rights on Resource Groups. This Microsoft Azure subscription account I am using is Pay as you go so there was no constraints but still receiving same issue. I did some googling but didn't find much helpful (Although got some hint from this link), As I like to use powershell for troubleshooting in most of the cases. I installed PowerShell for Azure, and logged into my Microsoft Azure subscription. (I am running Powershell version 4 so no need to load Modules it is automatically imported).
Login-AzureRmAccount -TenantId 11111111-11111-11111111-1111111111111 -SubscriptionId 11111111-11111-11111111-1111111111111 -EnvironmentName AzureCloud

(If you are not sure about what is the TenantId and SubscriptionID for Azure you can simply run Login-AzureRmAccount, it will ask for username and password once login is successful run Get-AzureRmSubscription to know your Tenant ID and Subscription ID).
Get-AzureRmResourceProvider

After running above command, it shows all registered Azure providers in the list, It says it has registered Microsoft.Storage and Microsoft.Web provider namespaces, I tried creating one Storage Account and Azure Web App it was successful.

ProviderNamespace               RegistrationState
-----------------               -----------------
Microsoft.Batch                 Registered
microsoft.insights              Registered
Microsoft.OperationalInsights   Registered
Microsoft.Security              Registered
Microsoft.Storage               Registered
Microsoft.Web                   Registered
Microsoft.ADHybridHealthService Registered
Microsoft.Authorization         Registered
Microsoft.Features              Registered
Microsoft.Resources             Registered
microsoft.support               Registered

azure powershell login-azurermaccount, get-azurermresourceprovider.png, list resource provider namespaces registered only

I was confirmed that this is Azure provider namespaces registration issue. To confirm I ran another one liner command. As I can see now Registration State for each Azure namespace, whether it is registered or unregistered. It means even though I am using Pay as you go account still I am restricted to kind of resources I can create.
Get-AzureRmResourceProvider -ListAvailable

Micrsoft Azure Get-azurermresourceprovider -listavailable list all providers registered and unregistered

Here is the complete list of all Microsoft Azure resource provider namespaces at current. 
Microsoft.Batch
microsoft.insights
Microsoft.OperationalInsights
Microsoft.Security
Microsoft.Storage
Microsoft.Web
Aspera.Transfers
Citrix.Cloud
Cloudyn.Analytics
Conexlink.MyCloudIT
Dynatrace.Ruxit
LiveArena.Broadcast
Lombiq.DotNest
Microsoft.ADHybridHealthService
Microsoft.ApiManagement
Microsoft.AppService
Microsoft.Authorization
Microsoft.Automation
Microsoft.BingMaps
Microsoft.BizTalkServices
Microsoft.Cache
Microsoft.Cdn
Microsoft.CertificateRegistration
Microsoft.ClassicCompute
Microsoft.ClassicNetwork
Microsoft.ClassicStorage
Microsoft.ClassicInfrastructureMigrate
Microsoft.CognitiveServices
Microsoft.Compute
Microsoft.ContainerService
Microsoft.ContentModerator
Microsoft.DataCatalog
Microsoft.DataFactory
Microsoft.DataLakeAnalytics
Microsoft.DataLakeStore
Microsoft.Devices
Microsoft.DevTestLab
Microsoft.DocumentDB
Microsoft.DomainRegistration
Microsoft.DynamicsLcs
Microsoft.EventHub
Microsoft.Features
Microsoft.HDInsight
Microsoft.KeyVault
Microsoft.Logic
Microsoft.MachineLearning
Microsoft.MarketplaceOrdering
Microsoft.Media
Microsoft.Network
Microsoft.NotificationHubs
Microsoft.OperationsManagement
Microsoft.Portal
Microsoft.PowerBI
Microsoft.RecoveryServices
Microsoft.ResourceHealth
Microsoft.Resources
Microsoft.Scheduler
Microsoft.Search
Microsoft.ServerManagement
Microsoft.ServiceBus
Microsoft.ServiceFabric
Microsoft.Sql
Microsoft.StreamAnalytics
microsoft.support
microsoft.visualstudio
Myget.PackageManagement
NewRelic.APM
Pokitdok.Platform
RavenHq.Db
Raygun.CrashReporting
Sendgrid.Email
Signiant.Flight
SuccessBricks.ClearDB
TrendMicro.DeepSecurity
U2uconsult.TheIdentityHub

Although it was not possible to register these providers with my contributor rights. I had to ask my manager with owner access on subscription to perform below steps (Or the person has full privileges can create any of the resource on Azure portal will automatically register the azure resource provider). Any of unregistered provider namespace can be registered using below command, and This is a one time action. 
Register-AzureRmResourceProvider -ProviderNamespace Microsoft.Compute

Microsoft Azure register-rmresourceprovider -providernamespace Microsoft.Computer Network confirm

And in the last once provider is registered it can be verified using command Get-AzureRmResourceProvider again.

Microsoft Azure get-azurermresourceprovider microsoft.computer microsoft.network, storage, web, sql

In the last it is not necessary to run above commands, User who has full access can create any of resource and associated resource provider will get registered automatically. I was stuck because I didn't have authority. But my manager had and he is not that technical so I can give him these script and can get my work done in a minute.

Go Back

Comment