From 845c864dc9b12bae0712ff15019c3b82e22c17cf Mon Sep 17 00:00:00 2001 From: Kelly Faessen Date: Wed, 12 Aug 2026 11:14:57 +0200 Subject: [PATCH] feat: make blob versioning configurable on storage_account_public (AB#9281) Follow-up to #461. Object replication requires both the change feed and blob versioning on the source account, and Azure rejects an update that turns either off. With change_feed_enabled configurable the next apply moved on to InvalidRequestPropertyValue: The value 'False' is not allowed for property isVersioningEnabled because Object Replication is enabled. Accounts under an object replication policy can now declare versioning_enabled = true. The default keeps the current behaviour. --- modules/azure/storage_account_public/main.tf | 1 + modules/azure/storage_account_public/variables.tf | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/modules/azure/storage_account_public/main.tf b/modules/azure/storage_account_public/main.tf index 76812367..2c59dfb9 100644 --- a/modules/azure/storage_account_public/main.tf +++ b/modules/azure/storage_account_public/main.tf @@ -36,6 +36,7 @@ resource "azurerm_storage_account" "storage_account" { blob_properties { change_feed_enabled = var.change_feed_enabled + versioning_enabled = var.versioning_enabled dynamic "cors_rule" { for_each = var.cors_rules diff --git a/modules/azure/storage_account_public/variables.tf b/modules/azure/storage_account_public/variables.tf index f09e4760..7a31b90e 100644 --- a/modules/azure/storage_account_public/variables.tf +++ b/modules/azure/storage_account_public/variables.tf @@ -116,6 +116,12 @@ variable "delete_retention_policy_days" { default = null } +variable "versioning_enabled" { + type = bool + description = "Enable or disable blob versioning. Azure keeps versioning on for as long as an object replication policy uses this account as its source and rejects an update that turns it off, so such an account has to set this to true." + default = false +} + variable "change_feed_enabled" { type = bool description = "Enable or disable the blob service change feed. Azure keeps the change feed on for as long as an object replication policy uses this account as its source and rejects an update that turns it off, so such an account has to set this to true."