The following arguments are supported:
NOTE:
Changing the account_kind value from Storage to StorageV2 will not trigger a force new on the storage account, it will only upgrade the existing storage account from Storage to StorageV2 keeping the existing storage account in place.
NOTE:
Blobs with a tier of Premium are of account kind StorageV2.
NOTE:
At this time min_tls_version is only supported in the Public Cloud, China Cloud, and US Government Cloud.
NOTE:
At this time allow_nested_items_to_be_public is only supported in the Public Cloud, China Cloud, and US Government Cloud.
Note:
Terraform uses Shared Key Authorisation to provision Storage Containers, Blobs and other items - when Shared Key Access is disabled, you will need to enable the storage_use_azuread flag in the Provider block to use Azure AD for authentication, however not all Azure Storage services support Active Directory authentication.
NOTE:
This can only be true when account_tier is Standard or when account_tier is Premium and account_kind is BlockBlobStorage
NOTE:
This can only be true when account_tier is Standard and account_kind is StorageV2, or account_tier is Premium and account_kind is BlockBlobStorage. Additionally, the is_hns_enabled is true.
NOTE:
queue_properties cannot be set when the account_kind is set to BlobStorage
NOTE:
static_website can only be set when the account_kind is set to StorageV2 or BlockBlobStorage.
NOTE:
For the queue_encryption_key_type and table_encryption_key_type, the Account key type is only allowed when the account_kind is set to StorageV2
NOTE:
This can only be true when account_kind is StorageV2 or when account_tier is Premium and account_kind is one of BlockBlobStorage or FileStorage.
NOTE:
SFTP support requires is_hns_enabled set to true. More information on SFTP support can be found here. Defaults to false
A blob_properties block supports the following:
A cors_rule block supports the following:
A custom_domain block supports the following:
A customer_managed_key block supports the following:
NOTE:
customer_managed_key can only be set when the account_kind is set to StorageV2 or account_tier set to Premium, and the identity type is UserAssigned.
A delete_retention_policy block supports the following:
A restore_policy block supports the following:
A container_delete_retention_policy block supports the following:
A hour_metrics block supports the following:
An identity block supports the following:
NOTE:
This is required when type is set to UserAssigned or SystemAssigned, UserAssigned.
Note
The assigned principal_id and tenant_id can be retrieved after the identity type has been set to SystemAssigned and Storage Account has been created. More details are available below.
An immutability_policy block supports the following:
NOTE
: This argument specifies the default account-level immutability policy which is inherited and applied to objects that do not possess an explicit immutability policy at the object level. The object-level immutability policy has higher precedence than the container-level immutability policy, which has a higher precedence than the account-level immutability policy.
A logging block supports the following:
A minute_metrics block supports the following:
A network_rules block supports the following:
Note:
If specifying network_rules, one of either ip_rules or virtual_network_subnet_ids must be specified and default_action must be set to Deny.
NOTE:
Network Rules can be defined either directly on the azurerm_storage_account resource, or using the azurerm_storage_account_network_rules resource - but the two cannot be used together. If both are used against the same Storage Account, spurious changes will occur. When managing Network Rules using this resource, to change from a default_action of Deny to Allow requires defining, rather than removing, the block.
Note:
The prefix of ip_rules must be between 0 and 30 and only supports public IP addresses.
Note:
More information on Validation is available here
A private_link_access block supports the following:
A azure_files_authentication block supports the following:
Note:
If directory_type is set to AADKERB, active_directory is not supported. Use icals to configure directory and file level permissions.
A active_directory block supports the following:
A routing block supports the following:
A queue_properties block supports the following:
A sas_policy block supports the following:
A static_website block supports the following:
A share_properties block supports the following:
A retention_policy block supports the following:
A smb block supports the following:
resource "azurerm_resource_group" "example" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_storage_account" "example" {
name = "storageaccountname"
resource_group_name = azurerm_resource_group.example.name
location = azurerm_resource_group.example.location
account_tier = "Standard"
account_replication_type = "GRS"
tags = {
environment = "staging"
}
}
az storage account create --name
--resource-group
[--access-tier {Cool, Hot, Premium}]
[--account-type]
[--action]
[--allow-append {false, true}]
[--allow-blob-public-access {false, true}]
[--allow-cross-tenant-replication {false, true}]
[--allow-shared-key-access {false, true}]
[--assign-identity]
[--azure-storage-sid]
[--bypass {AzureServices, Logging, Metrics, None}]
[--custom-domain]
[--default-action {Allow, Deny}]
[--default-share-permission {None, StorageFileDataSmbShareContributor, StorageFileDataSmbShareElevatedContributor, StorageFileDataSmbShareReader}]
[--dns-endpoint-type {AzureDnsZone, Standard}]
[--domain-guid]
[--domain-name]
[--domain-sid]
[--edge-zone]
[--enable-alw {false, true}]
[--enable-files-aadds {false, true}]
[--enable-files-aadkerb {false, true}]
[--enable-files-adds {false, true}]
[--enable-hierarchical-namespace {false, true}]
[--enable-large-file-share]
[--enable-local-user {false, true}]
[--enable-nfs-v3 {false, true}]
[--enable-sftp {false, true}]
[--encryption-key-name]
[--encryption-key-source {Microsoft.Keyvault, Microsoft.Storage}]
[--encryption-key-type-for-queue {Account, Service}]
[--encryption-key-type-for-table {Account, Service}]
[--encryption-key-vault]
[--encryption-key-version]
[--encryption-services {blob, file, queue, table}]
[--forest-name]
[--https-only {false, true}]
[--identity-type {None, SystemAssigned, SystemAssigned,UserAssigned, UserAssigned}]
[--immutability-period]
[--immutability-state {Disabled, Locked, Unlocked}]
[--key-exp-days]
[--key-vault-federated-client-id]
[--key-vault-user-identity-id]
[--kind {BlobStorage, BlockBlobStorage, FileStorage, Storage, StorageV2}]
[--location]
[--min-tls-version {TLS1_0, TLS1_1, TLS1_2}]
[--net-bios-domain-name]
[--public-network-access {Disabled, Enabled}]
[--publish-internet-endpoints {false, true}]
[--publish-microsoft-endpoints {false, true}]
[--require-infrastructure-encryption {false, true}]
[--routing-choice {InternetRouting, MicrosoftRouting}]
[--sam-account-name]
[--sas-exp]
[--sku {Premium_LRS, Premium_ZRS, Standard_GRS, Standard_GZRS, Standard_LRS, Standard_RAGRS, Standard_RAGZRS, Standard_ZRS}]
[--subnet]
[--tags]
[--user-identity-id]
[--vnet-name]
az storage account create -n mystorageaccount -g MyResourceGroup -l westus --sku Standard_LRS
Categorized by Availability, Security & Compliance and Cost