Skip to content

Commit

Permalink
Add azure reference docs
Browse files Browse the repository at this point in the history
  • Loading branch information
r4victor committed May 22, 2023
1 parent d09b884 commit bb32fd3
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 0 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions docs/docs/guides/projects.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
55 changes: 55 additions & 0 deletions docs/docs/reference/backends/azure.md
Original file line number Diff line number Diff line change
@@ -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 }
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit bb32fd3

Please sign in to comment.