未找到 Azure 站点恢复结构注册

问题描述

我正在尝试创建 1 个 VM azure 站点恢复配置并使用来自 https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/site_recovery_replicated_vm 的示例 terraform 代码

provider "azurerm" {
  version = ">= 2.49.0"
  features {
    
  }
}

Once deployment reached to site fabric configuration i am getting below error:

Error: Error checking for presence of existing site recovery fabric dplprimary-fabric (vault dlp01example-recovery-vault): siterecovery.ReplicationFabricsClient#Get: Failure responding to request: StatusCode=404 -- Original Error: autorest/azure: Service returned an error. Status=404 Code="NotFound" Message="Fabric with name dplprimary-fabric Could not be located." Details=[{"activityId":"","clientRequestId":"","code":"FabricArmEntityMissing","message":"Fabric with name dplprimary-fabric Could not be located.","possibleCauses":"The fabric might have been unregistered from the Microsoft Azure Site Recovery vault.","recommendedAction":"Retry the operation with a valid site."}]

  on main.tf line 218,in resource "azurerm_site_recovery_fabric" "primary":
 218: resource "azurerm_site_recovery_fabric" "primary" {

解决方法

此问题已在 azurerm 提供程序的 2.46 版中引入,并已由 pull request 11130 修复。将您的提供程序更新到一个 >= 2.54 的版本,一切正常