Access to each storage type is through a storage account
Storage Redundancy
LRS: Local redundancy, 3 copies within a single datacenter, read/write balanced across the 3 copies. Datacenter failure poses risk.
GRS: Geo-redundant, different regions. Primary region has 3 copies; secondary region gets 3 async copies, but secondary is not readable/writable unless failover is initiated.
RA-GRS: Compared to GRS, secondary region’s 3 copies are also readable.
ZRS: Data replicated across different Availability Zones within the same region, 3 copies across 3 AZs.
GZRS: ZRS + 3 backup copies in another region.
Storage Account Endpoints
A storage account provides a unique namespace. Its endpoint combines the account name with the Azure Storage service domain; append the container and blob path to address an object. Example: https://mystorageaccount.blob.core.chinacloudapi.cn/mycontainer/myblob.
Azure Blob
Binary Large Object - Azure’s object storage solution for the cloud, suitable for storing large amounts of binary objects. Use cases:
Serve images and documents directly to browsers for distributed access
Video and audio streaming
Backup, restore, disaster recovery, archiving
Azure managed service analytics
Blob has three types:
Block Blob: Stores text and binary data
Append Blob: Optimized for append operations, suitable for storing data from VMs
Page Blob: Stores large random-access files, suitable for storing VHD as VM disks
Blob Access Tiers
Hot tier: Frequently accessed data
Cool tier: Infrequently used but immediately accessible data (short-term backup and DR). Minimum 30 days storage.
Archive access tier: Offline tier, optimized for rarely accessed data. Must rehydrate to cool/hot tier for read/modify. Minimum 180 days storage, otherwise extra charges.
Azure Managed Disk
Azure managed, used with Azure VMs. Analogous to physical disks in on-premises servers but virtualized. Types: Premium SSD, Standard SSD, Standard HDD.
Disk Types
OS disk: Contains the operating system and boot volume.
Data disk: Stores application data.
Temporary disk:
Most VMs include this; it is NOT a managed disk
Used for page files (memory swap partition), uses host machine disk
On Linux typically /dev/sdb, default mount point /mnt/resource
On Windows typically D:\
Temporary Disk Data Loss
During VM failure, temporary storage does NOT migrate. Never store important data on temporary disk.
Authorization
Access Key
When creating a storage account, Azure generates two 512-bit storage account access keys
These keys authorize access to data via shared key authorization
Access Keys are essentially root passwords, providing all access to all services
Use either key; typically use the first and reserve the second for key rotation
SAS Token
SAS (Shared Access Signature) grants scoped access to storage resources
When creating SAS, specify constraints: which storage resources, what permissions, and the validity period
SAS is signed using access keys, two methods:
Signed with AAD-provided keys = User Delegation SAS
Signed with storage account keys = Service SAS / Account SAS
IOPS: Input/Output per second. For OLTP applications (e.g., online retail), high concurrency demands with insert/update-intensive transactions.
Throughput: Data volume sent to disk in a given time interval. For data warehouse applications, single requests access large data volumes (scan-intensive).
IO requests are the unit of input/output operations for applications
OLTP: large amounts of random IO
Data warehouse: large sequential IO
Reduce IO size to improve IOPS (e.g., 8KB for OLTP); increase IO size for throughput (e.g., 1024KB for data warehouse)
Cache has separate IOPS and throughput tied to VM size; as read time extends, cache warms up. Azure Premium Storage VMs use BlobCache (host RAM + local SSD combination).
Caching
Cache is stored on physical host machine disk, provided by Compute resources, with good performance.
ReadOnly:
Reduces read latency, achieves higher IOPS and throughput
Cached reads happen on local VM and local SSD, much faster than data disk reads (which happen on Blob)
ReadWrite:
Default for OS disk
Uses appropriate methods to write data from cache to permanent disk
None:
Only data disks support this; OS disks do not
Setting OS disk cache to None will internally override to ReadOnly
SQL Server on Premium Storage
Configure ReadOnly cache on premium storage disks hosting data files
Fast cache reads shorten SQL Server query time
Reading from cache provides more throughput for SQL Server for backup/restore, bulk load, index rebuild
Configure None cache on premium storage disks hosting log files
Log files primarily have frequent write operations; ReadOnly cache is not beneficial
Queue Depth
Queue depth is closely related to multi-threading. Queue depth indicates the degree of parallelism an application can achieve.
High queue depth allows more operations to queue on disk. The disk can plan ahead and process optimally.
Too high queue depth can negatively impact application latency.
Formula: ==IOPS * Latency = Queue Depth==
Striped volumes should maintain enough queue depth so each disk has its own peak queue depth. For example, if queue depth is 2 with 4 striped disks, only 2 disks will be busy. Configure queue depth to keep all disks busy.
AKS Upload Files to Storage
curl Test Pod Connecting to Storage
kubectl run curl-testing --image curl:latest --image-pull-policy=IfNotPresent --restart=Never --rm -it curl-testing -- curl "https://<sa name>.blob.core.chinacloudapi.cn/<container name>/<file name>?<sas>"curl: (7) Failed to connect to curl-testing port 80: Connection refusedcurl: (6) Could not resolve host: curl########################################## Testing Connection Success########################################
tee pv-download.yaml <<'EOF'apiVersion: v1kind: PersistentVolumemetadata: annotations: pv.kubernetes.io/provisioned-by: blob.csi.azure.com name: pv-blob-downloadspec: capacity: storage: 10Gi accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain # If set as "Delete" container would be removed after pvc deletion storageClassName: managed-blobfuse-premium-lrs mountOptions: - -o allow_other - --file-cache-timeout-in-seconds=120 csi: driver: blob.csi.azure.com # volumeid has to be unique for every identical storage blob container in the cluster # character `#`and `/` are reserved for internal use and cannot be used in volumehandle volumeHandle: <handle name> volumeAttributes: containerName: <container name> nodeStageSecretRef: name: <secret name> namespace: defaultEOF
tee pv-upload.yaml <<'EOF'apiVersion: v1kind: PersistentVolumemetadata: annotations: pv.kubernetes.io/provisioned-by: blob.csi.azure.com name: pv-blob-upload namespace: <ns name>spec: capacity: storage: 10Gi accessModes: - ReadWriteMany persistentVolumeReclaimPolicy: Retain # If set as "Delete" container would be removed after pvc deletion storageClassName: managed-blobfuse-premium-lrs mountOptions: - -o allow_other - --file-cache-timeout-in-seconds=120 csi: driver: blob.csi.azure.com # volumeid has to be unique for every identical storage blob container in the cluster # character `#`and `/` are reserved for internal use and cannot be used in volumehandle volumeHandle: <handle name> volumeAttributes: storageAccount: <sa name> containerName: <container name> AzureStorageAuthType: MSI AzureStorageIdentityClientID: <client id> AzureStorageIdentityResourceID: <uai id> #MSIEndpoint: EOF