Hello,
I'm trying to create following storage account:
resource "azurerm_storage_account" "blob-storage-account-1-13-05-25" {
name = "bsa1130525"
account_kind = "StorageV2"
resource_group_name = module.resource-group-storage-1-13-05-25.name
location = local.default_location
account_tier = "Standard"
account_replication_type = "LRS"
cross_tenant_replication_enabled = false
access_tier = "Hot"
blob_properties {
cors_rule {
allowed_headers = ["*"]
allowed_methods = []
allowed_origins = []
exposed_headers = ["*"]
max_age_in_seconds = 30
}
restore_policy {
days = 3
}
versioning_enabled = true
change_feed_enabled = true
change_feed_retention_in_days = 7
last_access_time_enabled = true
delete_retention_policy {
days = 7
permanent_delete_enabled = false
}
container_delete_retention_policy {
days = 7
}
}
routing {
publish_internet_endpoints = false
publish_microsoft_endpoints = true
choice = "MicrosoftRouting"
}
https_traffic_only_enabled = true
allow_nested_items_to_be_public = false
shared_access_key_enabled = true
default_to_oauth_authentication = true
is_hns_enabled = false
nfsv3_enabled = false
infrastructure_encryption_enabled = false
local_user_enabled = true
dns_endpoint_type = "Standard"
allowed_copy_scope = "AAD"
public_network_access_enabled = true
min_tls_version = "TLS1_2"
tags = local.default_tags
}
I've compared it with BICEP template:
param storageAccounts_bsa1130525_name string = 'bsa1130525'
resource storageAccounts_bsa1130525_name_resource 'Microsoft.Storage/storageAccounts@2024-01-01' = {
name: storageAccounts_bsa1130525_name
location: 'northeurope'
tags: {
iac: 'Terraform'
owner: 'DevOps'
project: 'Az Documents'
}
sku: {
name: 'Standard_LRS'
tier: 'Standard'
}
kind: 'BlobStorage'
identity: {
type: 'None'
}
properties: {
dnsEndpointType: 'Standard'
allowedCopyScope: 'AAD'
defaultToOAuthAuthentication: true
publicNetworkAccess: 'Enabled'
allowCrossTenantReplication: false
routingPreference: {
routingChoice: 'MicrosoftRouting'
publishMicrosoftEndpoints: true
publishInternetEndpoints: false
}
isNfsV3Enabled: false
isLocalUserEnabled: true
isSftpEnabled: false
minimumTlsVersion: 'TLS1_2'
allowBlobPublicAccess: false
allowSharedKeyAccess: true
isHnsEnabled: false
networkAcls: {
resourceAccessRules: []
bypass: 'AzureServices'
virtualNetworkRules: []
ipRules: []
defaultAction: 'Allow'
}
supportsHttpsTrafficOnly: true
encryption: {
services: {
file: {
keyType: 'Account'
enabled: true
}
blob: {
keyType: 'Account'
enabled: true
}
}
keySource: 'Microsoft.Storage'
}
accessTier: 'Hot'
}
}
resource storageAccounts_bsa1130525_name_default 'Microsoft.Storage/storageAccounts/blobServices@2024-01-01' = {
parent: storageAccounts_bsa1130525_name_resource
name: 'default'
sku: {
name: 'Standard_LRS'
tier: 'Standard'
}
properties: {
changeFeed: {
retentionInDays: 7
enabled: true
}
containerDeleteRetentionPolicy: {
enabled: true
days: 7
}
cors: {
corsRules: []
}
deleteRetentionPolicy: {
allowPermanentDelete: false
enabled: true
days: 7
}
isVersioningEnabled: true
}
}
When I do terraform apply I've encountered this error:
Error: updating blob_properties
: unexpected status 400 (400 Bad Request) with error: ContainerOperationFailure: The value for one of the XML nodes is not in the correct format.
│ RequestId:b5af7c96-501e-002b-6761-d47633000000
│ Time:2025-06-03T08:25:45.9178272Z
│
│ with azurerm_storage_account.blob-storage-account-1-13-05-25,
│ on main.tf line 8, in resource "azurerm_storage_account" "blob-storage-account-1-13-05-25":
│ 8: resource "azurerm_storage_account" "blob-storage-account-1-13-05-25" {
Note the account is being created, however without the properties like versioning.

Can anyone help with this? Thanks.