Closed ausfestivus closed 5 years ago
hi @ausfestivus
Taking a look at the error being returned from the Azure API here:
The access token requested for audience https://graph.microsoft.com by application 554a5294-f9bd-495e-9dbe-5de320fd9858 in tenant a5aa424e-5d6f-47c9-bf70-a1310f4be302 is missing the required claim role Directory.Read.All.
It appears the Service Principal being used doesn't have permission to read items in Azure Active Directory, which is happening when the AKS API is validating the Service Principal prior to using it. If this is a new Service Principal there's an additional step required after creating the Service Principal outlined here: https://www.terraform.io/docs/providers/azuread/auth/service_principal_configuration.html - would you be able to take a look and see if that works for you?
Since this is a question regarding Terraform Configuration rather than a bug in the Azure Provider I'm going to close this issue for the moment, but please let us know if that doesn't work for you and we'll take another look.
Thanks!
Hey Tom,
Appreciate the response. I did what you advised and have not had any change in behaviour.
If I run the build from TFC I get the error. (TFC uses an SP to talk to Azure [that SP works for other TFC builds]. The Kube SP is present.) If I run the build using the Azure CLI it works. I am using the example described at https://github.com/terraform-providers/terraform-provider-azurerm/tree/master/examples/kubernetes/role-based-access-control-azuread.
I cannot see what im missing here and im unsure how to really get down lower to divine what's happening.
Sorry @tombuildsstuff I didnt tag you in the above response so you may not have seen it.
I'm going to lock this issue because it has been closed for 30 days β³. This helps our maintainers find and focus on the active issues.
If you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. If you feel I made an error π€ π , please reach out to my human friends π hashibot-feedback@hashicorp.com. Thanks!
Community Note
Terraform (and AzureRM Provider) Version
Affected Resource(s)
azurerm_kubernetes_cluster
Terraform Configuration Files
Debug Output
https://gist.github.com/ausfestivus/95923bfd17a7af0c7f54f8faa4b205a6
Panic Output
nil
Expected Behavior
AKS Cluster created via TFC.
Actual Behavior
The following error is displayed during the apply.
Steps to Reproduce
terraform apply
Important Factoids
az aks create ...
command the AKS cluster is created.azurerm_kubernetes_cluster
is using for RBAC is in the same AAD as the TFC SP.References
AKS doco for SPs AzureRM Provider Example used for
azurerm_kubernetes_cluster
Edits
0000