The subscription is not registered to use namespace -Microsoft.Datafactory

Hi friends, today I will show you the solution of a common error when you plan to start working with Azure Services which you have never used before in your Azure Subscription. There are many services in Azure which is not available initially unless you register them for example Azure Data Factory, Blockchain etc.

In today’s example, I will show you how to do that, I will choose an Azure Subscription where we have not used the Azure Data factory before. And I am trying to create a new Azure Datafactory as you can see below.
New-AzDataFactory -ResourceGroupName "xxxxx-xxxxx-RG" -Name "xxxxPOC" -Location "WestUS"

And I got the above error. Let’s see how to overcome this error.

In Azure, for each functionality there’s a resource provider (Microsoft.DataFactory for example).

By default, your Azure Subscription is not registered with all resource providers and because our Subscription is not registered with Microsoft.DataFactory resource provider, so we’re getting this error.

If you get the similar error what you have to do is manually register your subscription with a resource provider. If you’re using Azure PowerShell, you can use

Register-AzResourceProvider -ProviderNamespace Microsoft.DataFactory

You can always replace the .Datafactory with service name which you need.

That’s all for today. Thanks for your time. You have a great day ahead.