hashicorp / terraform-provider-azuread

Terraform provider for Azure Active Directory
https://registry.terraform.io/providers/hashicorp/azuread/latest/docs
Mozilla Public License 2.0
415 stars 280 forks source link

azuread_application_app_role always either deletes / recreates the role on each apply #1402

Closed AlexcFrench closed 3 weeks ago

AlexcFrench commented 3 weeks ago

Community Note

Terraform (and AzureAD Provider) Version

Terraform v1.8.0 on windows_amd64

Affected Resource(s)

azuread_application_app_role

Terraform Configuration Files

resource "azuread_application" "appreg" {
  display_name = "test123"
}

resource "azuread_application_app_role" "role1" {
  application_id       = azuread_application.appreg.id
  role_id              = "6bd5554f-a935-4e9f-9223-c87a64c22fba"
  allowed_member_types = ["User"]
  description          = "desc"
  display_name         = "displayname"
  value                = "123"
}

Debug Output

https://gist.github.com/AlexcFrench/8303351be3f32ac1fac99df9b618b11f

Expected Behavior

once applied there should be no changes required on subsequent plan/apply runs

Actual Behavior

a tf plan / apply creates the role Another plan / apply deletes the role Another plan / apply recreates the role

No code changes at any point

Steps to Reproduce

tf init tf plan tf apply tf plan tf apply

  1. terraform apply

Important Factoids

MAY be related to #1344 ??

References

manicminer commented 3 weeks ago

Thanks for reporting this @AlexcFrench, you are correct that #1344 is related - in fact it's the same issue. Accordingly, I'll close this issue as a duplicate and ask that you subscribe to #1344 for updates, thanks!