I want to automate the backup my azure Postgresql flex databases to azure fileshares named as ex:"backup_psql" within Azure Storage account?. The backup should take place at certain interval. The expected architecture is given bellow. The storage account and file share i have created using terraform. Now how can i run the backup process automatically? I really appreciate your suggestions
Create a azure storgae account using terraform
# Create a storgae account
resource "azurerm_storage_account" "backup_storage" {
#name = "pssql_storage"
name = var.storage_account
resource_group_name = data.azurerm_resource_group.rg_pssql_flex.name
location = data.azurerm_resource_group.rg_pssql_flex.location
account_tier = "Standard"
account_replication_type = "LRS"
min_tls_version = "TLS1_2"
queue_properties {
logging {
delete = true
read = true
write = true
version = "1.0"
retention_policy_days = 10
}
}
}
Create a file share using terraform
resource "azurerm_storage_share" "backup_storage_share" {
name = local.azure_storage_share_name
storage_account_name = azurerm_storage_account.backup_storage.name
quota = var.backup_storage_quota
}