Skip to content
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

Resource 'data.azurerm_client_config.current' does not have attribute 'service_principal_application_id' #2108

Closed
ahanoff opened this issue Oct 18, 2018 · 4 comments

Comments

@ahanoff
Copy link

ahanoff commented Oct 18, 2018

Community Note

  • Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
  • Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
  • If you are interested in working on this issue or have submitted a pull request, please leave a comment

Terraform Version

Terraform v0.11.8
provider.azurerm v1.16.0

Affected Resource(s)

  • azurerm_client_config

Terraform Configuration Files

data "azurerm_client_config" "current" {}

output "account_id" {
  value = "${data.azurerm_client_config.current.client_id}"
}

output "tenant_id" {
  value = "${data.azurerm_client_config.current.tenant_id}"
}

output "subscription_id" {
  value = "${data.azurerm_client_config.current.subscription_id }"
}

output "service_principal_application_id" {
  value = "${data.azurerm_client_config.current.service_principal_application_id}"
}

output "service_principal_object_id" {
  value = "${data.azurerm_client_config.current.service_principal_object_id}"
}

Debug Output

https://gist.github.com/ahanoff/a90e87e18294ad1e0b0344a4b0ff75ba

Panic Output

Expected Behavior

Return service_principal_object_id and service_principal_application_id as described in documentation

Actual Behavior

Error output: Resource 'data.azurerm_client_config.current' does not have attribute 'service_principal_application_id'

Steps to Reproduce

  1. terraform init
  2. terraform apply

Important Factoids

References

  • #0000
@katbyte
Copy link
Collaborator

katbyte commented Oct 19, 2018

Hi @ahanoff,

How are authenticating with azure? Currently the datasource does not populate those fields if a service principle is not being used and because of that if you access them there is an error.

I have opened #2120 so that they will instead be set to an empty string.

@ahanoff
Copy link
Author

ahanoff commented Oct 20, 2018 via email

@tombuildsstuff
Copy link
Contributor

hi @ahanoff

Just to let you know that this has been released as a part of v1.18 of the AzureRM Provider (the full changelog is available here). You can upgrade to this by specifying the version in the provider block (as shown below) and then running terraform init -upgrade

provider "azurerm" {
  version = "=1.18.0"
}

Thanks!

@ghost
Copy link

ghost commented Mar 6, 2019

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 👉 [email protected]. Thanks!

@ghost ghost locked and limited conversation to collaborators Mar 6, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants