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)