Skip to content

Commit

Permalink
Merge pull request #815 from hashicorp/user-upn-noforcenew
Browse files Browse the repository at this point in the history
azuread_user: user_principal_name should not be ForceNew
  • Loading branch information
manicminer authored Jun 7, 2022
2 parents a5666f3 + 3ea9253 commit 78340c4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/services/users/user_resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ func userResource() *schema.Resource {
Description: "The user principal name (UPN) of the user",
Type: schema.TypeString,
Required: true,
ForceNew: true,
ValidateDiagFunc: validate.StringIsEmailAddress,
},

Expand Down Expand Up @@ -545,6 +544,7 @@ func userResourceUpdate(ctx context.Context, d *schema.ResourceData, meta interf
StreetAddress: utils.NullableString(d.Get("street_address").(string)),
Surname: utils.NullableString(d.Get("surname").(string)),
UsageLocation: utils.NullableString(d.Get("usage_location").(string)),
UserPrincipalName: utils.String(d.Get("user_principal_name").(string)),
}

if password := d.Get("password").(string); d.HasChange("password") && password != "" {
Expand Down
2 changes: 1 addition & 1 deletion internal/services/users/user_resource_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ resource "azuread_user" "manager" {
}
resource "azuread_user" "test" {
user_principal_name = "acctestUser'%[1]d@${data.azuread_domains.test.domains.0.domain_name}"
user_principal_name = "acctestUser'%[1]d-complete@${data.azuread_domains.test.domains.0.domain_name}"
mail = "acctestUser.%[1]d@hashicorp.biz"
mail_nickname = "acctestUser-%[1]d-MailNickname"
other_mails = ["acctestUser.%[1]d@hashicorp.net", "acctestUser.%[1]d@hashicorp.org"]
Expand Down

0 comments on commit 78340c4

Please sign in to comment.