Skip to main content

Azure Disks and Files

Azure Disks for databases and single-pod stateful workloads. Azure Files for shared storage across pods. Pick wrong and you get either poor performance or unnecessary complexity.

Azure disks

Block storage that attaches to a single node. Think of it as a virtual hard drive plugged into one VM.

Best for: Databases (PostgreSQL, MySQL, MongoDB), message queues, anything IOPS-sensitive with single-writer access.

TierIOPSThroughputUse Case
Premium SSD v2Up to 80,000Up to 1,200 MB/sProduction databases (best price/performance)
Premium SSDUp to 20,000Up to 900 MB/sProduction workloads with predictable patterns
Standard SSDUp to 6,000Up to 750 MB/sDev/test environments only
Ultra DiskUp to 160,000Up to 4,000 MB/sExtreme IOPS (SAP HANA, large SQL instances)
Standard HDDUp to 2,000Up to 500 MB/sNever use in AKS
Opinion

Premium SSD v2 for production databases -- it offers configurable IOPS/throughput independent of disk size, so you don't overpay for capacity you don't need just to get more IOPS. Standard SSD for dev/test. Never HDD for anything in AKS.

PVC example: Azure disk

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: postgres-data
spec:
accessModes:
- ReadWriteOnce
storageClassName: managed-csi
resources:
requests:
storage: 256Gi
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
name: postgres
spec:
template:
spec:
containers:
- name: postgres
volumeMounts:
- mountPath: /var/lib/postgresql/data
name: data
volumes:
- name: data
persistentVolumeClaim:
claimName: postgres-data

Azure files

Network file shares (SMB or NFS) accessible from multiple pods simultaneously.

Best for: Shared configuration, CMS content directories, legacy apps that need a file system shared across instances.

ProtocolOS SupportPerformanceUse Case
NFS 4.1Linux onlyBetter for small files, lower latencyLinux workloads needing shared storage
SMB 3.0Linux + WindowsGood for large sequential I/OWindows containers, cross-platform
Common Mistake

Don't use Azure Files for databases. The network latency of a file share compared to a locally-attached disk will destroy your database performance. Use Azure Disks for anything that does frequent random I/O.

PVC example: Azure files (NFS)

apiVersion: v1
kind: PersistentVolumeClaim
metadata:
name: shared-content
spec:
accessModes:
- ReadWriteMany
storageClassName: azurefile-csi-premium
resources:
requests:
storage: 100Gi

Decision matrix

RequirementUseWhy
Database storageAzure Disks (Premium SSD v2)Lowest latency, highest IOPS
Shared content across podsAzure Files (NFS)ReadWriteMany access
Windows container storageAzure Files (SMB)Only RWX option for Windows
ML training data (large files)Azure Blob NFSCheapest for large datasets
Temp/cache dataemptyDir or ephemeral disksNo persistence needed

Performance tuning

# Custom StorageClass for Premium SSD v2 with specific IOPS
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: premiumv2-custom
provisioner: disk.csi.azure.com
parameters:
skuName: PremiumV2_LRS
DiskIOPSReadWrite: "5000"
DiskMBpsReadWrite: "200"
reclaimPolicy: Retain
volumeBindingMode: WaitForFirstConsumer
allowVolumeExpansion: true
info

Premium SSD v2 lets you set IOPS and throughput independently of disk size. A 100Gi disk can have 5000 IOPS instead of being locked to the size-based tier. This is why it's the best choice for production.

Resources