From ed0fd61575c79000a471bf569e3ca73ceff8331b Mon Sep 17 00:00:00 2001 From: mcharriere Date: Mon, 25 Mar 2019 16:57:16 -0300 Subject: [PATCH] azurerm_recovery_serivces_protection_policy_vm: fixed ID error (#3108) Fixes #3063 --- azurerm/data_source_recovery_services_protection_policy_vm.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/azurerm/data_source_recovery_services_protection_policy_vm.go b/azurerm/data_source_recovery_services_protection_policy_vm.go index cde01ed20418..04cf4eb6bf61 100644 --- a/azurerm/data_source_recovery_services_protection_policy_vm.go +++ b/azurerm/data_source_recovery_services_protection_policy_vm.go @@ -3,6 +3,7 @@ package azurerm import ( "fmt" "log" + "strings" "github.com/hashicorp/terraform/helper/schema" "github.com/terraform-providers/terraform-provider-azurerm/azurerm/utils" @@ -51,7 +52,8 @@ func dataSourceArmRecoveryServicesProtectionPolicyVmRead(d *schema.ResourceData, return fmt.Errorf("Error making Read request on Recovery Service Protection Policy %q (Resource Group %q): %+v", name, resourceGroup, err) } - d.SetId(*protectionPolicy.ID) + id := strings.Replace(*protectionPolicy.ID, "Subscriptions", "subscriptions", 1) + d.SetId(id) flattenAndSetTags(d, protectionPolicy.Tags) return nil