Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure: MissingRegistrationForLocation: The subscription is not registered for the resource type 'XXXX' in the location 'YYYY'

This started out as a SubscriptionNotFound error.

var dnsClient = new DnsManagementClient(new Microsoft.Azure.TokenCloudCredentials(result.AccessToken));

var zone = dnsClient.Zones.CreateOrUpdate("someresourcegroup", "mydomain.com", new Microsoft.Azure.Management.Dns.Models.ZoneCreateOrUpdateParameters {
        IfNoneMatch = "*",
        Zone = new Microsoft.Azure.Management.Dns.Models.Zone {
            Name = "mydomain.com",
            Location = "northeurope"
        }
    });

Now I've fixed that, thanks to the reply on the original question. It's still the same code, and I have re-registered for the feature/provider with the follow powershell command:

Register-AzurermresourceProvider -ProviderNamespace Microsoft.Network

But that doesn't take an location parameter, and the error is about a resource in a location. What gives? And I have tried with "North Europe" instead of "northeurope", same result.

So what am I missing? Can't seem to find any data on this issue, not here and not on Google.

The complete error message is:

MissingRegistrationForLocation: The subscription is not registered for the resource type 'dnszones' in the location 'northeurope'. Please re-register for this provider in order to have access to this location.

like image 927
Steen Tøttrup Avatar asked Jan 29 '16 09:01

Steen Tøttrup


2 Answers

Just got this error message while trying to deploy through Visual Studio 2015. Upgrading to the latest Azure SDK, v2.9.6, fixed the problem.

like image 67
johnnie mac Avatar answered Oct 03 '22 08:10

johnnie mac


Azure DNS is a global service. Please try changing your location from northeurope to global. That should fix the error.

var zone = dnsClient.Zones.CreateOrUpdate("someresourcegroup", "mydomain.com", new Microsoft.Azure.Management.Dns.Models.ZoneCreateOrUpdateParameters {
        IfNoneMatch = "*",
        Zone = new Microsoft.Azure.Management.Dns.Models.Zone {
            Name = "mydomain.com",
            Location = "global"
        }
    });
like image 20
Gaurav Mantri Avatar answered Oct 03 '22 08:10

Gaurav Mantri