From 2e48b0de5f27cc411eeb3e108fee4bb8c1fd3992 Mon Sep 17 00:00:00 2001 From: kt Date: Thu, 14 May 2020 20:52:54 -0700 Subject: [PATCH] data.azuread_user[s] - use equals insteadof startsWith to find users with email --- azuread/helpers/graph/user.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azuread/helpers/graph/user.go b/azuread/helpers/graph/user.go index 4576eab2f..8fff3a2b5 100644 --- a/azuread/helpers/graph/user.go +++ b/azuread/helpers/graph/user.go @@ -37,7 +37,7 @@ func UserGetByObjectId(client *graphrbac.UsersClient, ctx context.Context, objec } func UserGetByMailNickname(client *graphrbac.UsersClient, ctx context.Context, mailNickname string) (*graphrbac.User, error) { - filter := fmt.Sprintf("startswith(mailNickname,'%s')", mailNickname) + filter := fmt.Sprintf("mailNickname eq '%s'", mailNickname) resp, err := client.ListComplete(ctx, filter, "") if err != nil { return nil, fmt.Errorf("Error listing Azure AD Users for filter %q: %+v", filter, err)