I am trying to read a backup-protected file share in Azure using the azurerm_backup_protected_file_share
resource in my Terraform script. However, when I try to execute the script, I get the following error message:
Error: BMSUserErrorCrossRegionRestoreNotEnabledInThisVault: Cross region restore is not enabled for the backup vault <vault_name>.
I have double-checked that the backup vault exists and that the file share is protected by a backup policy in the vault. I have also confirmed that the credentials I am using to authenticate with Azure have the necessary permissions to access the backup vault.
What could be causing this error, and how can I resolve it?
Try changing the verion of your provider .
I have following azurerm provider version and it worked.
Providers.tf
azurerm = {
source = "hashicorp/azurerm"
//version = "=3.0.2"
version = "=3.50.0"
}
Code:
resource "azurerm_backup_container_storage_account" "protection-container" {
resource_group_name = xxxx
recovery_vault_name = xxxx
storage_account_id = xxx
}
resource "azurerm_backup_policy_file_share" "example" {
name = "tfexxxxpolicy"
resource_group_name = data.azurerm_resource_group.example.name
recovery_vault_name = azurerm_recovery_services_vault.vault.name
backup {
frequency = "Daily"
time = "23:00"
}
retention_daily {
count = 10
}
}
resource "azurerm_backup_protected_file_share" "share1" {
resource_group_name = data.azurerm_resource_group.example.name
recovery_vault_name = azurerm_recovery_services_vault.vault.name
source_storage_account_id = azurerm_backup_container_storage_account.protection-container.storage_account_id
source_file_share_name = azurerm_storage_share.example.name
backup_policy_id = azurerm_backup_policy_file_share.example.id
}