hashicorp / terraform-provider-azuread

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

bugfix: end_date_relative for application_password #1428

Open nickdala opened 1 month ago

nickdala commented 1 month ago

This fix supports end_date_relative for azuread_application_password. See https://github.com/hashicorp/terraform-provider-azuread/issues/843 and https://github.com/hashicorp/terraform-provider-azuread/issues/1424 for more details.

Terraform version

Terraform v1.9.1 on darwin_amd64

Provider version

2.53.1

Terraform Configuration Files

data "azuread_client_config" "current" {}

resource "azuread_application" "example" {
  display_name = "example"
  owners       = [data.azuread_client_config.current.object_id]
}

resource "azuread_application_password" "application_password" {
  application_id = azuread_application.example.id
  end_date_relative = "360h" # 15 days
}

Expected Behavior

The expiration of the client secret in Microsoft Entra ID is calculated based on the end_date_relative argument.

Actual Behavior

end_date_relative is ignored and the expiration of the client secret in Microsoft Entra ID is set to the default of 2 years.

Steps to Reproduce

terraform apply

Sample

https://github.com/nickdala/azure-app-registration

Fixed #1424