From b33bd427e1449356138a777723b0f2491d4e1072 Mon Sep 17 00:00:00 2001 From: Maxime Bury Date: Thu, 19 May 2016 16:44:29 +0100 Subject: [PATCH] Normalizes availability_set_id to lowercase to avoid spurious diffs (#6768) --- builtin/providers/azurerm/resource_arm_virtual_machine.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/builtin/providers/azurerm/resource_arm_virtual_machine.go b/builtin/providers/azurerm/resource_arm_virtual_machine.go index 0c3f95e67..080f423d0 100644 --- a/builtin/providers/azurerm/resource_arm_virtual_machine.go +++ b/builtin/providers/azurerm/resource_arm_virtual_machine.go @@ -5,6 +5,7 @@ import ( "fmt" "log" "net/http" + "strings" "time" "github.com/Azure/azure-sdk-for-go/arm/compute" @@ -69,6 +70,9 @@ func resourceArmVirtualMachine() *schema.Resource { Type: schema.TypeString, Optional: true, Computed: true, + StateFunc: func(id interface{}) string { + return strings.ToLower(id.(string)) + }, }, "license_type": &schema.Schema{ @@ -480,7 +484,7 @@ func resourceArmVirtualMachineRead(d *schema.ResourceData, meta interface{}) err } if resp.Properties.AvailabilitySet != nil { - d.Set("availability_set_id", resp.Properties.AvailabilitySet.ID) + d.Set("availability_set_id", strings.ToLower(*resp.Properties.AvailabilitySet.ID)) } d.Set("vm_size", resp.Properties.HardwareProfile.VMSize)