From 165c4544da8bae96e546a3d33f8ce2b8fe052f5d Mon Sep 17 00:00:00 2001 From: Jakub Adamus Date: Mon, 24 Apr 2023 13:28:14 +0200 Subject: [PATCH] Support older version of aad_auth Fixes https://github.com/petoju/terraform-provider-mysql/issues/79 --- mysql/resource_user.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mysql/resource_user.go b/mysql/resource_user.go index ccce9134..4f7c3a62 100644 --- a/mysql/resource_user.go +++ b/mysql/resource_user.go @@ -338,9 +338,10 @@ func ReadUser(ctx context.Context, d *schema.ResourceData, meta interface{}) dia if m[3] == "aad_auth" { // AADGroup:98e61c8d-e104-4f8c-b1a6-7ae873617fe6:upn:Doe_Family_Group // AADUser:98e61c8d-e104-4f8c-b1a6-7ae873617fe6:upn:little.johny@does.onmicrosoft.com - // AADSP:98e61c8d-e104-4f8c-b1a6-7ae873617fe6:upn:mysqlUserName + // AADSP:98e61c8d-e104-4f8c-b1a6-7ae873617fe6:upn:mysqlUserName - for MySQL Flexible Server + // AADApp:98e61c8d-e104-4f8c-b1a6-7ae873617fe6:upn:mysqlUserName - for MySQL Single Server parts := strings.Split(m[4], ":") - if parts[0] == "AADSP" { + if parts[0] == "AADSP" || parts[0] == "AADApp" { // service principals are referenced by UUID only d.Set("aad_identity", []map[string]interface{}{ {