Storage account blob versioning soft delete [SOLVED]

I’m writing a storage account module for my company to consume and I want to enable the soft delete for blob versioning as seen in the picture. I can set the versioning on, but I can’t find any documentation on how to change the retention policy specifically for the versioning.

Also, if a storage account module expert is out there and wants to throw me a bone. I can’t get the restore policy to work. I have everything that it requires in the documentation, but I get this error:

Error: updating Azure Storage Account blob_properties “testname”: storage.BlobServicesClient#SetServiceProperties: Failure sending request: StatusCode=409 – Original Error: autorest/azure: Service returned an error. Status= Code=“FeatureNotSupportedForAccount” Message=“Point-In-Time Restore is not supported for the account.”

Solved this after some research. For some reason this retention policy is unique and just creates a lifecycle management rule. So what you do to include it in the module storage account creation is use the azurerm_storage_management_policy resources to set the version retention you’d like.

I also figured out that I couldn’t turn on point in time restore because I had version level immutability enabled which are incompatible with each other. Weird how it explicitly states this in the known issues but it cannot give a specific error.

1 Like