> ## Documentation Index
> Fetch the complete documentation index at: https://docs.domino.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Provision Terraform infrastructure for Azure

Use this topic to provision infrastructure with [Microsoft Azure](https://azure.microsoft.com/overview/what-is-azure/). After the infrastructure is in place, you can deploy Domino on [Azure Kubernetes Service (AKS)](https://azure.microsoft.com/services/kubernetes-service/).

<Warning>
  * A Domino install can’t be hosted on a subdomain of another Domino install. For example, if you have Domino deployed at `data-science.example.com`, you can’t deploy another instance of Domino at `acme.data-science.example.com`.

  * Do not run commands using AZ Command Line Interface (CLI) version 2.33.0. This includes shells that run AZ CLI version 2.33.0, such as Azure Cloud Shell. That version of AZ CLI contains a bug that prevents `vm create` from working.
</Warning>

## Orchestrate the installation

1. To start a VM in your Azure environment before you have a dedicated bastion or Azure VM, use [Azure Portal](https://docs.microsoft.com/azure/azure-resource-manager/management/manage-resource-groups-portal) or [Azure CLI](https://docs.microsoft.com/azure/azure-resource-manager/management/manage-resources-cli) to run the following:

   ```shell theme={null}
   az vm create \
   --resource-group $RG_NAME \
   --name bastion \
   --image UbuntuLTS \
   --admin-username azureuser \
   --generate-ssh-keys
   ```

2. Sign in to the VM.

3. Install the packages:

   ```shell theme={null}
   apt update
   curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
   curl -sL https://aka.ms/InstallAzureCLIDeb | sudo bash
   curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add -
   curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/amd64/kubectl"
   mv kubectl /usr/local/bin
   chmod +x /usr/local/bin/kubectl
   apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main"
   apt-get update && sudo apt-get install terraform
   apt install -y containerd docker.io
   ```

4. Add `azureuser` to the Docker group:

   ```shell theme={null}
   +usermod -a -G docker azureuser
   ```

5. Sign out to apply the group change:

   ```shell theme={null}
   logout
   ```

6. Sign in to the VM again.

7. Sign in to Azure:

   ```shell theme={null}
   az login
   ```

## Provision your infrastructure with Domino’s Terraform module

Domino recommends that you use our public-facing [Azure-specific Reference Terraform module](https://github.com/dominodatalab/terraform-azure-aks). You can also reference this module to manually provision the environment and infrastructure.

1. Create a resource group in your Azure subscription.

2. Open the `main.tf` [file](/attachments/6.3/azure-main.tf) and edit the following attributes:

   * `domino-aks.api_server_authorized_ip_ranges`: The IP ranges to allow incoming traffic into the server nodes. Enter `null` to allow all traffic.

   * `domino-aks.resource_group`: The name of the resource group that you created in the previous step.

   * `domino-aks.deploy_id`: The name of the AKS cluster to create.

   * `domino-aks.kubernetes_version`: The Kubernetes version.

   * Optional: `domino-aks.namespaces`: Update if you don’t want to use domino-platform and domino-compute.

   * Optional: `domino-aks.node_pools.compute.vm_size`: Update if you don’t want to use DS8\_v2 SKU.

   * Optional: `domino-aks.node_pools.compute.gpu`: Update if you don’t want to use the NC6s\_v3 SKU.

   * Optional: `domino-aks.node_pools.compute.platform`: Update if you don’t want to use the DS8\_v2 SKU.

3. To initialize the modules, run the following command in the same folder as `main.tf`:

   ```shell theme={null}
   terraform init
   ```

4. To start the infrastructure deployment, run the following commands:

   ```shell theme={null}
   terraform plan -out=terraform.plan
   terraform apply terraform.plan
   ```

<Tip>
  * You can ignore any deprecation warnings.

  * If you receive resource quota errors, [check](https://docs.microsoft.com/azure/azure-portal/supportability/view-quotas) that the vCPU quotas in your Azure subscription are large enough to fulfill the `node_pools` values.
</Tip>
