diff --git a/docs/assets/images/dstack-hub-create-azure-project.png b/docs/assets/images/dstack-hub-create-azure-project.png new file mode 100644 index 000000000..dc7c7e058 Binary files /dev/null and b/docs/assets/images/dstack-hub-create-azure-project.png differ diff --git a/docs/docs/guides/projects.md b/docs/docs/guides/projects.md index 0967321b8..7213d35c0 100644 --- a/docs/docs/guides/projects.md +++ b/docs/docs/guides/projects.md @@ -24,6 +24,12 @@ For instructions specific to a particular cloud, please refer to the relevant se [Learn more →](../../reference/backends/aws){ .md-button .md-button--primary } +??? info "Azure" + To use Azure, you will require a storage account for storing state and artifacts, as well as Azure AD app credentials + to access the corresponding cloud services. + + [Learn more →](../../reference/backends/azure){ .md-button .md-button--primary } + ??? info "GCP" To use GCP, you will require a cloud bucket for storing state and artifacts, as well as a service account to access the corresponding cloud services. diff --git a/docs/docs/reference/backends/azure.md b/docs/docs/reference/backends/azure.md new file mode 100644 index 000000000..bcba1adb5 --- /dev/null +++ b/docs/docs/reference/backends/azure.md @@ -0,0 +1,55 @@ +# Azure + +The `Azure` backend type allows to provision infrastructure and store state and artifacts in +an Azure account. + +Follow the step-by-step guide below to configure a project with this backend. + +## 1. Create a resource group + +First, create a new Azure resource group. All resource created by `dstack` will belong to this group. + +## 2. Create a storage account + +Next, create an Azure storage account in the newly created resource group. `dstack` will use this storage account to store metadata and artifacts. + +!!! info "NOTE:" + Make sure that the storage account is created in the same region where you plan to provision + infrastructure. + +## 3. Create an Azure Active Directory app + +`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. + +To create new application credentials using the Azure CLI, run: + +``` +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 }" +``` + +## 4. Create a project + +Now that you have the credentials set up, log in to the Hub, open the `Projects` page, click `Add`, and select `Azure` in +the `Type` field. + +![](../../../assets/images/dstack-hub-create-azure-project.png){ width=800 } + +It may take up to a minute to set up Azure resource after saving the project settings. + +### Fields reference + +The following fields are required: + +- `Tenant ID` - (Required) The Azure Tenant ID +- `Client ID` - (Required) The Client ID to authenticate `dstack` +- `Client Secret` - (Required) The Client secret to authenticate `dstack` +- `Subscription ID` - (Required) The Azure Subscription ID +- `Location` - (Required) The region where `dstack` will create provision infrastructure and store state and artifacts +- `Storage account` - (Required) The Storage account to store state and artifacts (must be in the same region) + +## 5. Configure the CLI + +!!! info "NOTE:" + Once you have created the project, feel free to use the CLI code snippet to configure it for use with the created project. + + [Learn more →](../../../guides/projects#configuring-the-cli){ .md-button .md-button--primary } diff --git a/mkdocs.yml b/mkdocs.yml index 568d6f0ba..51a06a873 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -170,6 +170,7 @@ nav: - docker: docs/reference/providers/docker.md - Backends: - AWS: docs/reference/backends/aws.md + - Azure: docs/reference/backends/azure.md - GCP: docs/reference/backends/gcp.md - Examples: https://github.com/dstackai/dstack-examples/blob/main/README.md - Slack: https://join.slack.com/t/dstackai/shared_invite/zt-xdnsytie-D4qU9BvJP8vkbkHXdi6clQ