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 firstname.lastname@example.org 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)|
|TIME||Friday, 26 August 2016, 15:43:30|
|RESOURCE||Test01 (resource group)|
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).
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.
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.
Here is the complete list of all Microsoft Azure resource provider namespaces at current.
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
And in the last once provider is registered it can be verified using command Get-AzureRmResourceProvider again.
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.