Open thomasteoh opened 1 month ago
Thank you for taking the time to open this issue. I am going to move it over to the Terraform AzureAD Repo since that is where these resources are found.
The new doc shows that it now expects the actual service principal ID but this breaking change is not documented anywhere in the upgrade guide.
resource "azuread_application" "example" {
display_name = "example"
}
resource "azuread_service_principal" "example" {
client_id = azuread_application.example.client_id
}
resource "azuread_service_principal_password" "example" {
service_principal_id = azuread_service_principal.example.id
}
The new doc shows that it now expects the actual service principal ID but this breaking change is not documented anywhere in the upgrade guide.
resource "azuread_application" "example" { display_name = "example" } resource "azuread_service_principal" "example" { client_id = azuread_application.example.client_id } resource "azuread_service_principal_password" "example" { service_principal_id = azuread_service_principal.example.id }
Thanks @mablouin - this has fixed the issue for me!
FYA, this PR was merged on Sep 27 updates the usage examples in the documentation:
Is there an existing issue for this?
Community Note
Terraform Version
1.9.7
AzureRM Provider Version
4.4.0
Affected Resource(s)/Data Source(s)
azuread_service_principal, azuread_service_principal_password
Terraform Configuration Files
Debug Output/Panic Output
Expected Behaviour
Either the ServicePrincipalId was produced with the number of segments expected by
azuread_service_principal_password
or theazuread_service_principal_password
expects or handles just the objectid of the service principalActual Behaviour
Error, number of segments not matching
Steps to Reproduce
terraform apply
Important Factoids
No response
References
Possibly related to other issues from the SDK update hashicorp/terraform-provider-azurerm#27461