|
| 1 | +# Azure |
| 2 | + |
| 3 | +The `Azure` backend type allows to provision infrastructure and store state and artifacts in |
| 4 | +an Azure account. |
| 5 | + |
| 6 | +Follow the step-by-step guide below to configure a project with this backend. |
| 7 | + |
| 8 | +## 1. Create a resource group |
| 9 | + |
| 10 | +First, create a new Azure resource group. All resource created by `dstack` will belong to this group. |
| 11 | + |
| 12 | +## 2. Create a storage account |
| 13 | + |
| 14 | +Next, create an Azure storage account in the newly created resource group. `dstack` will use this storage account to store metadata and artifacts. |
| 15 | + |
| 16 | +!!! info "NOTE:" |
| 17 | + Make sure that the storage account is created in the same region where you plan to provision |
| 18 | + infrastructure. |
| 19 | + |
| 20 | +## 3. Create an Azure Active Directory app |
| 21 | + |
| 22 | +`dstack` needs an Azure Active Directory app credentials to authenticate with your Azure account. If the app is `Owner` of the subscription, `dstack` will automatically set up all the resources required to run workflows. It will also create a separate managed identity with fine-grained permissions to authenticate with your Azure account when running workflows. |
| 23 | + |
| 24 | +To create new application credentials using the Azure CLI, run: |
| 25 | + |
| 26 | +``` |
| 27 | +az ad sp create-for-rbac --name dstack-app --role Owner --scopes /subscriptions/$SUBSCRIPTION_ID --query "{ client_id: appId, client_secret: password, tenant_id: tenant }" |
| 28 | +``` |
| 29 | + |
| 30 | +## 4. Create a project |
| 31 | + |
| 32 | +Now that you have the credentials set up, log in to the Hub, open the `Projects` page, click `Add`, and select `Azure` in |
| 33 | +the `Type` field. |
| 34 | + |
| 35 | +{ width=800 } |
| 36 | + |
| 37 | +It may take up to a minute to set up Azure resource after saving the project settings. |
| 38 | + |
| 39 | +### Fields reference |
| 40 | + |
| 41 | +The following fields are required: |
| 42 | + |
| 43 | +- `Tenant ID` - (Required) The Azure Tenant ID |
| 44 | +- `Client ID` - (Required) The Client ID to authenticate `dstack` |
| 45 | +- `Client Secret` - (Required) The Client secret to authenticate `dstack` |
| 46 | +- `Subscription ID` - (Required) The Azure Subscription ID |
| 47 | +- `Location` - (Required) The region where `dstack` will create provision infrastructure and store state and artifacts |
| 48 | +- `Storage account` - (Required) The Storage account to store state and artifacts (must be in the same region) |
| 49 | + |
| 50 | +## 5. Configure the CLI |
| 51 | + |
| 52 | +!!! info "NOTE:" |
| 53 | + Once you have created the project, feel free to use the CLI code snippet to configure it for use with the created project. |
| 54 | + |
| 55 | + [Learn more →](../../../guides/projects#configuring-the-cli){ .md-button .md-button--primary } |
0 commit comments