-
Notifications
You must be signed in to change notification settings - Fork 92
Description
This is a feature currently in Azure PowerShell. Basically, this wouldn't happen:
The subscription is not registered for the resource type 'dnszones' in the location 'West US 2'. Please re-register for this provider in order to have access to this location.
AFAIK, the runtime in Azure PowerShell evaluates the response and registers the resource it if the response was of this kind. After that, it resends the request. (Correct me if I'm wrong). But, this was a useful [behind-the-scenes] feature.
My thoughts are, we can do a proactive registration instead of a reactive one. But, I don't know if there is a downside to this approach. Registration is naturally asynchronous (You send the command to register, and it runs on Azure; which may take time, but not client-side time). So, there may be other approaches since we now have access to all of the resource type information at generation time.
Edit
I later came to find out that the error above wasn't a registration error per-se. However, when I looked at the registration for Microsoft.Network and looked at the ResourceTypes, I saw this:
ResourceTypeName : dnszones
Locations : {global}
ApiVersions : {2018-05-01, 2018-03-01-preview, 2017-10-01, 2017-09-15-preview...}So, the error above was that the only valid value for Location is global, which is... interesting. So, I provided that value and it worked appropriately.