Azure: The subscription is not registered to use namespace […]

Автор: | 08/09/2016
 

azure_logoВо время деплоя группы ресурсов — Azure сообщает об ошибке:

$ azure group deployment create jm-acs-1 jm-app-1-init -f azuredeploy.json -e azuredeploy.parameters.json
info:    Executing command group deployment create
+ Initializing template configurations and parameters                          
+ Creating a deployment                                                        
error:   Long running operation failed with error: 'At least one resource deployment operation failed. Please list deployment operations for details. Please see https://aka.ms/arm-debug for usage details.'.
info:    Error information has been recorded to /home/setevoy/.azure/azure.err
error:   group deployment create command failed

Проверяем лог /home/setevoy/.azure/azure.err:

...
\\"code\\": \\"ProvisioningFailed\\",\\r\\n        \\"message\\": \\"Provisioning of resource(s) for container service \'containerservice-jm-acs-1\' in resource group \'jm-acs-1\' failed with errors: Resource type: Microsoft.Network/virtualNetworks, name: swarm-vnet-2A4542BA, id: /subscriptions/63f2d0b6-***-***-***-2e2657dfd17d/resourceGroups/jm-acs-1/providers/Microsoft.Network/virtualNetworks/swarm-vnet-2A4542BA, StatusCode: Conflict, StatusMessage: \\\\\\\\n {\\\\r\\\\n  \\\\\\"error\\\\\\": {\\\\r\\\\n    \\\\\\"code\\\\\\": \\\\\\"MissingSubscriptionRegistration\\\\\\"
...

Тут обращаем внимание на два значения:

  • Resource type: Microsoft.Network
  • MissingSubscriptionRegistration

Проверяем:

$ azure provider list | grep "Microsoft.Network"
data:    Microsoft.Network                       Unregistered 

Проверяем текущую активную подписку:

$ azure account show
info:    Executing command account show
data:    Name                        : Meister Website
data:    ID                          : 63f2d0b6-***-***-***-2e2657dfd17d
data:    State                       : Enabled
data:    Tenant ID                   : 62c3c0ed-***-***-***-80daaa52f756
data:    Is Default                  : true
data:    Environment                 : AzureCloud
data:    Has Certificate             : No
data:    Has Access Token            : Yes
data:    User name                   : service@*.onmicrosoft.com

Подключаем к ней Microsoft.Network:

$ azure provider register Microsoft.Network
info:    Executing command provider register
+ Registering provider Microsoft.Network with subscription 63f2d0b6-***-***-***-2e2657dfd17d
error:   Namespace Microsoft.Network Registration took too long to complete
info:    Error information has been recorded to /home/setevoy/.azure/azure.err
error:   provider register command failed

Несмотря на сообщение «provider register command failed» — проверяем:

$ azure provider list | grep "Microsoft.Network"
data:    Microsoft.Network                       Registered   

Ох, Azure

Готово.

Аналогично — можно сразу зарегистрировать Microsoft.Storage и Microsoft.Compute.