Compare languages | Cloud provider — Azure: подготовка окружения

Внимание! Поддерживаются только регионы, в которых доступны Availability Zones.

Caution! Only regions where Availability Zones are available are supported.

Провайдер поддерживает работу только с одним диском в шаблоне виртуальной машины. Убедитесь, что шаблон содержит только один диск.

The provider supports working with only one disk in the virtual machine template. Make sure the template contains only one disk.

Для управления облаком Microsoft Azure необходимо иметь соответствующую учетную запись и хотя бы одну привязанную подписку (Subscription).

To rule the Microsoft Azure cloud, you need an account and at least a single Subscription connected to id.

Для управления ресурсами в облаке Microsoft Azure средствами Deckhouse необходимо создать service account. Для этого:

  1. Установите Azure CLI, авторизуйтесь и получите Subscription ID:

You have to create a service account with Microsoft Azure so that Deckhouse can manage cloud resources:

  1. Install the Azure CLI, login and get Subscription ID:

shell export SUBSCRIPTION_ID=$(az login | jq -r ‘.[0].id’)

shell export SUBSCRIPTION_ID=$(az login | jq -r ‘.[0].id’)

  1. Создайте service account:
  1. Create the service account:

shell az ad sp create-for-rbac –role=”Contributor” –scopes=”/subscriptions/$SUBSCRIPTION_ID” –name “DeckhouseCANDI”

shell az ad sp create-for-rbac –role=”Contributor” –scopes=”/subscriptions/$SUBSCRIPTION_ID” –name “DeckhouseCANDI”

Пример вывода команды:

Example output of the command:

console { “appId”: “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx”, <– используется в параметре clientId ресурса AzureClusterConfiguration “displayName”: “DeckhouseCANDI”, “password”: “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”, <– используется в параметре clientSecret ресурса AzureClusterConfiguration “tenant”: “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx” <– используется в параметре tenantId ресурса AzureClusterConfiguration }

console { “appId”: “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxx”, <– used in the clientId parameter of the AzureClusterConfiguration resource “displayName”: “DeckhouseCANDI”, “password”: “xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx”, <– used in the clientSecret parameter of the AzureClusterConfiguration resource “tenant”: “xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx” <– used in the tenantId parameter of the AzureClusterConfiguration resource }

По умолчанию срок действия секрета созданного service account (используется в параметре clientSecret ресурса AzureClusterConfiguration) — один год без автоматического продления. Чтобы создать service account с большим сроком действия секрета обратитесь к официальной документации.

By default, service account will be created with a secret (used in the clientSecret parameter of the AzureClusterConfiguration resource) validity period of one year without automatic renewal. Refer to the official documentation to create a service account with a longer secret expiration date.

Для дальнейшей работы с утилитой az необходимо авторизоваться, используя данные (login, password, tenant) созданного service account:

You have to be logged in for further work with the az tool. Use the service account username, password, and tenant to log in:

shell az login –service-principal -u -p --tenant

shell az login –service-principal -u -p --tenant