AzureStorage6 Min Read

Azure Storage Account: CLI vs Terraform

Efficiently managing Blob storage and File shares using automated workflows.

1

Azure CLI Execution

Storage names must be globally unique across all of Azure. Use lower-case letters and numbers only.

# Create Storage Account
az storage account create \
  --name devdstorage001 \
  --resource-group RG-Network-Dev \
  --location eastus \
  --sku Standard_LRS \
  --kind StorageV2
2

Terraform Declaration

Defining a scalable storage resource with encryption and network rules enabled.

resource "azurerm_storage_account" "sa" {
  name                     = "devdstorage001"
  resource_group_name      = azurerm_resource_group.main.name
  location                 = azurerm_resource_group.main.location
  account_tier             = "Standard"
  account_replication_type = "LRS"
}

Security Tip

"Always disable public network access and use Private Endpoints for storage accounts in production to prevent data leaks."