Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The subscription doesn't have permissions to register the resource provider Microsoft.Sql

I'm setup up as a contributor to a resource group in azure. I have successfully created a web app and a storage account, but I don't have permission to create a sql server and sql db?

I've been granted the following roles:

  • Contributor
  • SQL DB Contributor
  • SQL Security Manager
  • SQL Server Contributor
  • Website Contributor

But I still get this error when creating a sql server:

"The subscription Microsoft Azure Enterprise doesn't have permissions to register the resource prover(s): Microsoft.Sql."

enter image description here

like image 497
Blake Erickson Avatar asked Nov 09 '16 18:11

Blake Erickson


2 Answers

You do not need subscription contributor rights, but it looks like that subscription is missing the Microsoft.Sql Provider. Using the Az Module, if you run:

get-AzResourceProvider -ListAvailable | where-object {$_.Registrationstate -eq "Registered"}

You can see that it is missing. To add it, run:

Register-AzResourceProvider -ProviderNamespace Microsoft.Sql.

NB: This answer is adapted from Blake Erickson's comment on the answer he accepted to his own question, and is actually the right thing to do here. In contrast to another of the answers, I believe it is better not to register all resource providers as this may not be desired.

like image 182
Josh Gallagher Avatar answered Sep 23 '22 06:09

Josh Gallagher


To overcome this error you would need subscription owner rights, or make someone register that provider for you with appropriate rights, or create a custom role and assign that to user(s) that need to register providers.

https://blogs.msdn.microsoft.com/azure4fun/2016/10/20/common-problem-when-using-azure-resource-groups-rbac/

like image 38
4c74356b41 Avatar answered Sep 26 '22 06:09

4c74356b41