Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritise this request
Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritise the request
If you are interested in working on this issue or have submitted a pull request, please leave a comment
Terraform (and AzureAD Provider) Version
Terraform v1.7.5
on windows_amd64
+ provider registry.terraform.io/hashicorp/azuread v2.47.0
Affected Resource(s)
data.azuread_service_principal
Terraform Configuration Files
terraform {
required_version = "~>1.7"
required_providers {
azuread = {
source = "hashicorp/azuread"
version = "2.47.0"
}
}
backend "local" {
path = "./debug.tfstate"
}
}
provider "azuread" {
tenant_id = "xxxx"
}
data "azuread_service_principal" "msgraph" {
display_name = "Microsoft GrapH" # note the capital H
}
Debug Output
The debug output shows a successful call to https://graph.microsoft.com/v1.0/servicePrincipals?%24filter=displayName+eq+%27Microsoft+GrapH
The Graph result is exactly one service principal.
Yet the azuread provider concludes No service principal found matching display name: \"Microsoft GrapH\"
It should fetch the service principal because display name should be case insensitive
Actual Behavior
│ Error: No service principal found matching display name: "Microsoft GrapH"
│
│ with data.azuread_service_principal.msgraph,
│ on main.tf line 26, in data "azuread_service_principal" "msgraph":
│ 26: data "azuread_service_principal" "msgraph" {
│
Steps to Reproduce
Create a data source for a service principal based on display_name with incorrect casing for the value
Community Note
Terraform (and AzureAD Provider) Version
Affected Resource(s)
data.azuread_service_principal
Terraform Configuration Files
Debug Output
The debug output shows a successful call to
https://graph.microsoft.com/v1.0/servicePrincipals?%24filter=displayName+eq+%27Microsoft+GrapH
The Graph result is exactly one service principal. Yet the azuread provider concludesNo service principal found matching display name: \"Microsoft GrapH\"
https://gist.github.com/rsegers/6012f1106f36b1c184087b989ad3d5c1
Panic Output
Expected Behavior
It should fetch the service principal because display name should be case insensitive
Actual Behavior
Steps to Reproduce
Create a data source for a service principal based on
display_name
with incorrect casing for the valueterraform plan
Important Factoids
References
369