Open offlineadmin opened 3 months ago
From the provider docs: "The Azure Provider can be used to configure infrastructure in Azure Active Directory using the Microsoft Graph API." If the official API docs says that this endpoint isn't available in GCC High then the provider is working as expected.
The Microsoft documentation must be out of date. The endpoint is available as verified by using the Graph CLI which is a wrapper for the Graph API (https://learn.microsoft.com/en-us/graph/cli/overview).
Seems like a malformed payload as the body only contains type
and usage
. Not sure if that is related to the region.
Could you try setting the display_name
argument on the resource to see if that changes the behavior and/or output?
Here is the new TF resource:
resource "azuread_service_principal_token_signing_certificate" "nexusdev" {
service_principal_id = azuread_service_principal.nexusdev.object_id
display_name = "CN=NexusDevCert"
}
And this is the API request from the debug. Same error but display_name is shown:
Request ID: 0cdf9f4e-62df-33f3-a4ed-ac8e60cfeabe
POST /v1.0/servicePrincipals/ad81c254-7034-4c0a-b008-16db79e1815f/addTokenSigningCertificate HTTP/1.1
Host: graph.microsoft.us
User-Agent: HashiCorp Terraform/1.9.3 (+https://www.terraform.io) Terraform Plugin SDK/2.10.1 terraform-provider-azuread/2.53.1 Hamilton (Go-http-client/1.1) pid-222c6c49-1b0a-5959-a213-6608f9eb8820
Content-Length: 54
Accept: application/json; charset=utf-8; IEEE754Compatible=false
Content-Type: application/json; charset=utf-8
Odata-Maxversion: 4.0
Odata-Version: 4.0
Accept-Encoding: gzip
{"displayName":"CN=NexusDevCert","type":"","usage":""}
Community Note
Terraform (and AzureAD Provider) Version
Terraform v1.9.3 provider registry.terraform.io/hashicorp/azuread v2.53.1
Affected Resource(s)
azuread_service_principal_token_signing_certificate
Terraform Configuration Files
Debug Output
https://gist.github.com/offlineadmin/f039c2015b3dc34748be3c75abd111e8
Panic Output
Expected Behavior
Resource should have been created
Actual Behavior
The API post for addTokenSigningCertificate fails because TF is sending invalid parameters in the request body. See below on line 13
Steps to Reproduce
terraform apply -auto-approve
Important Factoids
This is in GCC High / USGov L4. I have tried this with TF for Windows and TF for Ubuntu. I manually used the API with the Graph CLI and it worked as expected with the same credentials in the same tenant.
I have tried using older versions of azuread provider and terraform, but no change
References
0000