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.azuread_service_principal: Support instantiating by client-id #183

Closed
erlacherl-city opened this issue Nov 27, 2019 · 2 comments
Closed

Comments

@erlacherl-city
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

Description

Azure supports querying service principals by client id:

az ad sp show --id e4223c08-d7c1-40a2-810a-d3f83e9b99d9

The client id is also the only thing that the data.azure_kubernetes_cluster data provider surfaces for the service_principal.

The data.azuread_service_principal data provider only supports using display name, object id, and application name.

This means, there is no way to get from an existing aks cluster to the object id of its service principal.

New or Affected Resource(s)

  • data.azuread_service_principal

Potential Terraform Configuration

data "azurerm_kubernetes_cluster" "my-cluster" {
    name = "myaks01"
    resource_group_name = data.azurerm_resource_group.somewhere.name
}

data "azuread_service_principal" "aks-sp" {
  client_id = data.azurem_kubernetes_cluster.my-cluster.service_principal[0].client_id
}
@manicminer
Copy link
Contributor

Hi @erlacherl-city, thanks for requesting this! Good news - the azuread_service_principal data source happily supports this already. The attribute you want is application_id, which is just another name for client_id.

Additionally, we recently added support for the application_id (e.g. the client_id) argument to the azuread_application data source. This will be in our next release v0.11.0 - see #274

@ghost
Copy link

ghost commented Jul 26, 2020

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 Jul 26, 2020
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

3 participants