I have boot diagnostics for the VMs configured in Azure Storage Account. I would like to keep the retention policy of the boot diagnostics. How do I implement the Retention policy for the boot diagnostics files in Azure Storage account container ?
resource "azurerm_virtual_machine" "vm" {
for_each = var.vm
name = lower("vm${each.value.index}")
resource_group_name = data.azurerm_resource_group.rg.name
location = data.azurerm_resource_group.rg.location
zones = ["${each.value.zone}"]
vm_size = var.vm_size
network_interface_ids = [azurerm_network_interface.nic[each.key].id]
storage_os_disk {
name = lower("vm${each.value.index}-os")
caching = "ReadWrite"
create_option = "FromImage"
managed_disk_type = var.disk_type
}
os_profile {
.....
.
.
}
boot_diagnostics {
enabled = true
storage_uri = azurerm_storage_account.sa.primary_blob_endpoint
}