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

data source azurerm_client_config has empty client_id and object_id when using msi #11553

Closed
chinwobble opened this issue May 2, 2021 · 3 comments

Comments

@chinwobble
Copy link

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 (and AzureRM Provider) Version

Terraform 0.15.1
AzureRM 2.57.0

Affected Resource(s)

  • data azurerm_client_config

Terraform Configuration Files

provider "azurerm" {
  features {}
}

terraform {
  required_providers {
    azurerm = {
      source  = "hashicorp/azurerm"
      version = "=2.57.0"
    }
  }

  backend "azurerm" {
    container_name = "tfstate"
    key            = "shared.terraform.tfstate"
  }
}

data "azurerm_client_config" "current" {}

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

Expected Behaviour

Data should return object_id of the managed identity.

Actual Behaviour

Data resource is missing object_id and client_id.

+ azurerm_config = {
      + client_id       = ""
      + id              = "2021-05-02 05:38:30.872363915 +0000 UTC"
      + object_id       = ""
      + subscription_id = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      + tenant_id       = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
      + timeouts        = null
    }

Steps to Reproduce

  1. Create a terraform module with azurerm backend and providers and MSI authentication.
  2. Create a linux azure VM with a system assigned identity
  3. Run terraform plan and pass in all details required for msi authetnication.

Important Factoids

  • using azure global environment
  • When you use azure_cli authentication, you can see the object_id.

References

  • #0000
@Theragus
Copy link

Duplicate of #7787

@tombuildsstuff
Copy link
Member

Duplicate of #7787 - thanks @Theragus

@github-actions
Copy link

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 have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 23, 2021
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