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

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/


Following the steps in the MS blog referenced in the accepted answer under the heading "Preregister all providers in a subscription" worked for me - once I realised that I had to select the correct subscription first.

So the commands that fixed it for me, which I ran in Azure Cloud Shell were:

PS Azure:\> Select-AzureRmSubscription -SubscriptionName "<The Subscription Name>"
PS Azure:\> get-AzureRmResourceProvider -ListAvailable | foreach-object{Register-AzureRmResourceProvider -ProviderNamespace $_.ProviderNamespace}