The subscription is not registered for resource types error

Recently one of my colleague ask from me is it possible to move a Azure SQL Database (PaaS) to another subscription. When he try to move the SQL database to another subscription it throws an error as below.

The subscription ‘<SubscriptionID>’ is not registered for resource types ‘Microsoft.Sql/servers (southeastasia),Microsoft.Sql/servers/databases (southeastasia)’. (Code: MissingRegistrationsForTypes

As per the error it prompting us the relevant resource type was not registered in the subscription.

When I feather inquiring about this I got to know that this subscription is newly created and doesn’t deploy any type of resources yet. So I run the following command in the PowerShell. Note before running following command make sure you logged in to azure and select the relevant subscription.


Get-AzureRmResourceProvider

When we run above PS command it gives the following, output may vary  depend on the environment working.

10681FCD

So I notice that Microsoft.Sql provider namespace was not registered it to subscription, for to fix this issue run the following command.Make sure to register the relevant dependent resources to SQL database (web apps, resource group etc) as well using this method.


Register-AzureRmResourceProvider -ProviderNamespace Microsoft.Sql

After that verify that the resources are registered


Get-AzureRmResourceProvider

6CFA4B6A

After registering the relevant resources SQL DB movement work successfully.

, , , ,

Post navigation

  • Ken

    Hi Kasun,

    Thanks very much for this article. I was attempting to move the contents of an entire Azure resource group from one subscription to another (Visual Studio MSDN account to a Pay-As-You-go account) and ran into exactly this problem. After installing an running power shell (https://azure.microsoft.com/en-us/documentation/articles/powershell-install-configure/) I successfully registered the namespaces as you suggest (for Microsoft.DocumentDB, Microsoft.Web and Microsoft.insights). I then re-tried moving the resource and hey presto, it successfully moved!

    Thanks again,
    Ken.

    • Kasun Rajapakse

      Hi Ken,

      Its great pleasure to hear this post help to resolve your problem. 🙂 🙂

      Thanks

  • Gulab Pasha

    Hi Guys,

    Sorry if it is a off topic question, I’m trying to move complete resource group to another subscription and get the following error, where as I have given ownership for both accounts to the resource group (Source and Destination). Move includes, VM, Storage Accounts, Networks & Public IP’s.

    PowerShell Script:

    $gulab=Login-AzureRmAccount
    $gulab=Get-AzureRmSubscription -SubscriptionId “My_Subscription_ID”$webapp = Get-AzureRmResource -ResourceGroupName ‘Source_ResourceGroup_Name’ -ResourceName Source_VM_Name

    $plan = Get-AzureRmResource -ResourceGroupName Destination_ResourceGroup_Name -ResourceName Destination_VM_Name
    Move-AzureRmResource -DestinationResourceGroupName Destination_ResourceGroup_Name -ResourceId $webapp.ResourceId -DestinationSubscriptionId “Another_Subscription_ID”

    Error:

    Get-AzureRmResource : ResourceGroupNotFound : Resource group ‘Destination_ResourceGroup_Name’ could not be found.

    At line:12 char:9

    + $plan = Get-AzureRmResource -ResourceGroupName Destination_ResourceGroup_Name -Resourc …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : CloseError: (:) [Get-AzureRmResource], ErrorResponseMessageException
    + FullyQualifiedErrorId : ResourceGroupNotFound,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.GetAzureResourceCmdlet

    Move-AzureRmResource : MissingRegistrationsForTypes : The subscription ‘new_subscription_id’ is not registered for resource types
    ‘Microsoft.Compute/virtualMachines (southeastasia)’.

    At line:13 char:1

    + Move-AzureRmResource -DestinationResourceGroupName Destination_ResourceGroup_Name -Res …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : CloseError: (:) [Move-AzureRmResource], ErrorResponseMessageException
    + FullyQualifiedErrorId :

    MissingRegistrationsForTypes,Microsoft.Azure.Commands.ResourceManager.Cmdlets.Implementation.MoveAzureResourceCommand

    Looking forward to your help & support.

    Thanks,
    Gulab Pasaha

    • Kasun Rajapakse

      Hi Gulab

      Can you try using Azure portal to move the resources I try it and it works without any errors.As I see in the error it mentioned relevent resource group not available in destination subscription. First create a RG in destination subscription and try it again.

      “Successfully moved 6 resources from resource group ‘CentOS’ in subscription ‘MSDN Platforms’ to resource group ‘testvnet’ in subscription ‘Visual Studio Premium with MSDN’ “