terraform-provider-azurerm: Error reading azurerm_backup_protected_vm - BMSUserErrorCrossRegionRestoreNotEnabledInThisVault

Is there an existing issue for this?

  • I have searched the existing issues

Community Note

  • Please vote on this issue by adding a πŸ‘ reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave β€œ+1” or β€œme too” comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

1.3.9

AzureRM Provider Version

3.55.0

Affected Resource(s)/Data Source(s)

azurerm_backup_protected_vm

Terraform Configuration Files

resource "azurerm_backup_protected_vm" "this" {
  recovery_vault_name = "example-vault"
  resource_group_name = "example"
  source_vm_id        = "/subscriptions/xxx/resourceGroups/example/providers/Microsoft.Compute/virtualMachines/example-dev"
  backup_policy_id    = "/subscriptions/xxx/resourceGroups/example/providers/Microsoft.RecoveryServices/vaults/example-vault/backupPolicies/TestEnvPolicy"
}

Debug Output/Panic Output

Error: checking for presence of existing Protected Item (Subscription: "xxx"
β”‚ Resource Group Name: "example"
β”‚ Vault Name: "example-vault"
β”‚ Backup Fabric Name: "Azure"
β”‚ Protection Container Name: "iaasvmcontainer;iaasvmcontainerv2;example;example-dev"
β”‚ Protected Item Name: "VM;iaasvmcontainerv2;example;example-dev"): protecteditems.ProtectedItemsClient#Get: Failure responding to request: StatusCode=400 -- Original Error: autorest/azure: Service returned an error. Status=400 Code="BMSUserErrorCrossRegionRestoreNotEnabledInThisVault" Message="Cross Region Restore is not enabled in this vault. Please enable Cross Region Restore in this vault."

Expected Behaviour

Resource read request should pass successfully, azurerm_backup_protected_vm created.

Actual Behaviour

Resource read request fails with 400.

Steps to Reproduce

Create any valid configuration for a backup protected vm and try to run terraform apply. Terraform plan will also fail for existing resources.

This can also be reproduced with a simple rest method GET request using api version 2023-02-01. It will give the following output for both existing and non-existing resources: Bad Request({"error":{"code":"BMSUserErrorCrossRegionRestoreNotEnabledInThisVault","message":"Cross Region Restore is not enabled in this vault. Please enable Cross Region Restore in this vault."}})

Meanwhile api version 2021-02-10 returns as expected: Not Found({"error":{"code":"BMSUserErrorDataSourceObjectNotFound","message":"Item not found. Selected item might have been deleted. Please check if item is registered to the vault."}})

API reference: https://learn.microsoft.com/en-us/rest/api/backup/protected-items/get?tabs=HTTP

Important Factoids

No response

References

No response

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Reactions: 52
  • Comments: 22 (5 by maintainers)

Commits related to this issue

Most upvoted comments

Also experiencing this same issue

Also seeing this issue is Release v3.55.0 Rolling back to v3.54.0 removed the issue

Hi @avooca , this is going to be fixed in days.

+1 on the issue. Reverting to 3.54.0 bypasses the error for us.

Hi @avooca , just gave it a try without any error. Could you please give it another try? And if it’s still error out could you please provide which region you are using?

Thanks

All good in West Europe now, this morning not so much. Appreciate the follow up.

Hi @avooca , just gave it a try without any error. Could you please give it another try? And if it’s still error out could you please provide which region you are using?

Thanks

downgrading to 3.54.0 solved the problem for me too

To confirm, downgrading to 3.54.0 solved the problem for me.