Quickstart for installing and configuring Azure Container Storage Preview with Azure Kubernetes Service (AKS) (2023)

  • Article

Azure Container Storage is a cloud-based volume management, deployment, and orchestration service built natively for containers. This Quickstart shows you how to configure and use Azure Container Storage for use with Azure Kubernetes Service (AKS). At the end, you'll have new storage classes that you can use for your Kubernetes workloads, and you can then create a storage pool using one of three block storage options.


  • Use the Bash environment in Azure Cloud Shell. For more information, see Quickstart for Bash in Azure Cloud Shell.

    Quickstart for installing and configuring Azure Container Storage Preview with Azure Kubernetes Service (AKS) (1)

  • If you prefer to run CLI reference commands locally, install the Azure CLI. If you're running on Windows or macOS, consider running Azure CLI in a Docker container. For more information, see How to run the Azure CLI in a Docker container.

    • If you're using a local installation, sign in to the Azure CLI by using the az login command. To finish the authentication process, follow the steps displayed in your terminal. For other sign-in options, see Sign in with the Azure CLI.

    • When you're prompted, install the Azure CLI extension on first use. For more information about extensions, see Use extensions with the Azure CLI.

    • Run az version to find the version and dependent libraries that are installed. To upgrade to the latest version, run az upgrade.

Getting started

  • If you don't have an Azure subscription, create a free account before you begin.

  • Sign up for the public preview by completing the onboarding survey.

  • Make sure the identity you're using to create your AKS cluster has the appropriate minimum permissions. For more details, see Access and identity options for Azure Kubernetes Service.

  • This article requires version 2.0.64 or later of the Azure CLI. See How to install the Azure CLI. If you're using Azure Cloud Shell, the latest version is already installed. If you plan to run the commands in this quickstart locally instead of in Azure Cloud Shell, be sure to run them with administrative privileges.

  • If you're using Azure Cloud Shell, you might be prompted to mount storage. Select the Azure subscription where you want to create the storage account and select Create.

  • You'll need the Kubernetes command-line client, kubectl. It's already installed if you're using Azure Cloud Shell, or you can install it locally by running the az aks install-cli command.

Create a resource group

An Azure resource group is a logical group that holds your Azure resources that you want to manage as a group. When you create a resource group, you're prompted to specify a location. This location is:

  • The storage location of your resource group metadata.
  • Where your resources will run in Azure if you don't specify another region during resource creation.


Azure Container Storage Preview is only available in eastus, westus2, westus3, and westeurope regions.

  1. Set your subscription context using the az account set command. You can view the subscription IDs for all the subscriptions you have access to by running the az account list --output table command. Remember to replace <subscription-id> with your subscription ID.

    az account set --subscription <subscription-id>
  2. Create a resource group using the az group create command. Replace <resource-group-name> with the name of the resource group you want to create, and replace <location> with eastus, westus2, westus3, or westeurope.

    az group create --name <resource-group-name> --location <location>

    If the resource group was created successfully, you'll see output similar to this:

    { "id": "/subscriptions/<guid>/resourceGroups/myContainerStorageRG", "location": "eastus", "managedBy": null, "name": "myContainerStorageRG", "properties": { "provisioningState": "Succeeded" }, "tags": null}

Choose a data storage option and virtual machine type

Before you create your cluster, you should understand which back-end storage option you'll ultimately choose to create your storage pool. This is because different storage services work best with different virtual machine (VM) types as cluster nodes, and you'll deploy your cluster before you create the storage pool.

Data storage options

  • Azure Elastic SAN Preview: Azure Elastic SAN preview is a good fit for general purpose databases, streaming and messaging services, CD/CI environments, and other tier 1/tier 2 workloads. Storage is provisioned on demand per created volume and volume snapshot. Multiple clusters can access a single SAN concurrently, however persistent volumes can only be attached by one consumer at a time.

  • Azure Disks: Azure Disks are a good fit for databases such as MySQL, MongoDB, and PostgreSQL. Storage is provisioned per target container storage pool size and maximum volume size.

  • Ephemeral Disk: This option uses local NVMe drives on the AKS nodes and is extremely latency sensitive (low sub-ms latency), so it's best for applications with no data durability requirement or with built-in data replication support such as Cassandra. AKS discovers the available ephemeral storage on AKS nodes and acquires the drives for volume deployment.

VM types

To use Azure Container Storage, you'll need a node pool of at least three Linux VMs. Each VM should have a minimum of four virtual CPUs (vCPUs). Azure Container Storage will consume one core for I/O processing on every VM the extension is deployed to.

If you intend to use Azure Elastic SAN Preview or Azure Disks with Azure Container Storage, then you should choose a general purpose VM type such as standard_d4s_v5 for the cluster nodes. The VMs must have standard hard disk drives (HDD), not SSD.

If you intend to use Ephemeral Disk, choose a storage optimized VM type with NVMe drives such as standard_l8s_v3. In order to use Ephemeral Disk, the VMs must have NVMe drives.

Create AKS cluster

Run the following command to create a Linux-based AKS cluster and enable a system-assigned managed identity. Replace <resource-group> with the name of the resource group you created, <cluster-name> with the name of the cluster you want to create, and <vm-type> with the VM type you selected in the previous step. For this Quickstart, we'll create a cluster with three nodes. Increase the --node-count if you want a larger cluster.

az aks create -g <resource-group> -n <cluster-name> --node-count 3 -s <vm-type> --generate-ssh-keys

The deployment will take a few minutes to complete.


When you create an AKS cluster, AKS automatically creates a second resource group to store the AKS resources. This second resource group follows the naming convention MC_YourResourceGroup_YourAKSClusterName_Region. For more information, see Why are two resource groups created with AKS?.

Connect to the cluster

To connect to the cluster, use the Kubernetes command-line client, kubectl.

  1. Configure kubectl to connect to your cluster using the az aks get-credentials command. The following command:

    • Downloads credentials and configures the Kubernetes CLI to use them.
    • Uses ~/.kube/config, the default location for the Kubernetes configuration file. You can specify a different location for your Kubernetes configuration file using the --file argument.
    az aks get-credentials --resource-group <resource-group> --name <cluster-name>
  2. Verify the connection to your cluster using the kubectl get command. This command returns a list of the cluster nodes.

    kubectl get nodes
  3. The following output example shows the nodes in your cluster. Make sure the status for all nodes shows Ready:

    NAME STATUS ROLES AGE VERSIONaks-nodepool1-34832848-vmss000000 Ready agent 80m v1.25.6aks-nodepool1-34832848-vmss000001 Ready agent 80m v1.25.6aks-nodepool1-34832848-vmss000002 Ready agent 80m v1.25.6

    Take note of the name of your node pool. In this example, it would be nodepool1.

Label the node pool

Next, you must update your node pool label to associate the node pool with the correct IO engine for Azure Container Storage.

Run the following command to update the label. Remember to replace <resource-group> and <cluster-name> with your own values, and replace <nodepool-name> with the name of your node pool from the previous step.

az aks nodepool update --resource-group <resource group> --cluster-name <cluster name> --name <nodepool name> --labels acstor.azure.com/io-engine=acstor


You can verify that the node pool is correctly labeled by signing into the Azure portal and navigating to your AKS cluster. Go to Settings > Node pools, select your node pool, and under Taints and labels you should see Labels: acstor.azure.com/io-engine:acstor.

Assign Contributor role to AKS managed identity

Azure Container Service is a separate service from AKS, so you'll need to grant permissions to allow Azure Container Storage to provision storage for your cluster. Specifically, you must assign the Contributor Azure RBAC built-in role to the AKS managed identity. You'll need an Owner role for your Azure subscription in order to do this. If you don't have sufficient permissions, ask your admin to perform these steps.

  1. Sign into the Azure portal, and search for and select Kubernetes services.
  2. Locate and select your AKS cluster. Select Settings > Properties from the left navigation.
  3. Under Infrastructure resource group, you should see a link to the resource group that AKS created when you created the cluster. Select it.
  4. Select Access control (IAM) from the left pane.
  5. Select Add > Add role assignment.
  6. Under Assignment type, select Privileged administrator roles and then Contributor. If you don't have an Owner role on the subscription, you won't be able to add the Contributor role.
  7. Under Assign access to, select Managed identity.
  8. Under Members, click + Select members. The Select managed identities menu will appear.
  9. Under Managed identity, select User-assigned managed identity.
  10. Under Select, search for and select the managed identity with your cluster name and -agentpool appended.
  11. Select Review + assign.

Install Azure Container Storage

The initial install uses Azure Arc CLI commands to download a new extension. Replace <cluster-name> and <resource-group> with your own values. The <name> value can be whatever you want; it's just a label for the extension you're installing.

During installation, you might be asked to install the k8s-extension. Select Y.

az k8s-extension create --cluster-type managedClusters --cluster-name <cluster name> --resource-group <resource group name> --name <name of extension> --extension-type microsoft.azurecontainerstorage --scope cluster --release-train prod --release-namespace acstor

Installation takes 10-15 minutes to complete. You can check if the installation completed correctly by running the following command and ensuring that provisioningState says Succeeded:

az k8s-extension list --cluster-name <cluster-name> --resource-group <resource-group> --cluster-type managedClusters

Congratulations, you've successfully installed Azure Container Storage. You now have new storage classes that you can use for your Kubernetes workloads.

Next steps

Now you can create a storage pool and persistent volume claim, and then deploy a pod and attach a persistent volume. Follow the steps in the appropriate how-to article.

  • Use Azure Container Storage Preview with Azure Elastic SAN Preview
  • Use Azure Container Storage Preview with Azure Disks
  • Use Azure Container Storage with Azure Ephemeral disk (NVMe)
Top Articles
Latest Posts
Article information

Author: Tyson Zemlak

Last Updated: 04/11/2023

Views: 5971

Rating: 4.2 / 5 (43 voted)

Reviews: 82% of readers found this page helpful

Author information

Name: Tyson Zemlak

Birthday: 1992-03-17

Address: Apt. 662 96191 Quigley Dam, Kubview, MA 42013

Phone: +441678032891

Job: Community-Services Orchestrator

Hobby: Coffee roasting, Calligraphy, Metalworking, Fashion, Vehicle restoration, Shopping, Photography

Introduction: My name is Tyson Zemlak, I am a excited, light, sparkling, super, open, fair, magnificent person who loves writing and wants to share my knowledge and understanding with you.