-
Notifications
You must be signed in to change notification settings - Fork 4.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
azurerm_client_config error listing Service Principals #392
Comments
Hey @k1rk Thanks for opening this issue :) Taking a quick look into this, at the current time this data source assumes you're using a Service Principal and as such will fail when using Azure CLI auth. That said - we should fix this so that's not the case, or at least displays a more helpful error message. From what I can see, there's two separate errors which need to be fixed here:
Would it be possible in the interim to know if you're able to access the Application ID via the Thanks! p.s. given the Gist posted above contains some sensitive data (the Authorization tokens), I've removed the link to it - however whilst these may have expired, I'd suggest deleting this if possible! |
Update: I've opened PR #393 which includes a fix for this :) |
Tried with Service Principal authentication, still no luck provider "azurerm" {
subscription_id = "90**********************************"
client_id = "http://**-TERRAFORM"
client_secret = "19**********************************"
tenant_id = "8c**********************************"
}
data "azurerm_client_config" "current" {}
output "application_id" {
value = "${data.azurerm_client_config.current.service_principal_application_id}"
}
output
debughttps://gist.github.com/k1rk/a9c6f0b10882505d7be58981204f8542 |
@k1rk in your example the ClientID isn't correct, it should be a GUID - in the response back from the Azure CLI:
The field Thanks! |
it's worked.
|
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! |
Error on getting data from azurerm_client_config
* data.azurerm_client_config.current: data.azurerm_client_config.current: Error listing Service Principals: autorest.DetailedError{Original:(*azure.RequestError)(0xc420619ef0), PackageType:"graphrbac.ServicePrincipalsClient", Method:"List", StatusCode:401, Message:"Failure responding to request", ServiceError:[]uint8(nil), Response:(*http.Response)(0xc420619e60)}
Terraform Version
Affected Resource(s)
Terraform Configuration Files
Debug Output
[REMOVED]
Actual Behavior
failed to get any data
Steps to Reproduce
Please list the steps required to reproduce the issue, for example:
terraform plan
Important Factoids
Tried both with az cli auth and service principal
i'm not an admin of whole account but have subscription owner role
list service principals from az cli successful with same credentials
az ad sp list
The text was updated successfully, but these errors were encountered: