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

Use AZURE_CLIENT_ID & AZURE_TENANT_ID environment vars for AKS Workload Identity #549

Closed
ronaldvb-k opened this issue Jul 10, 2024 · 0 comments · Fixed by #598
Closed

Use AZURE_CLIENT_ID & AZURE_TENANT_ID environment vars for AKS Workload Identity #549

ronaldvb-k opened this issue Jul 10, 2024 · 0 comments · Fixed by #598
Milestone

Comments

@ronaldvb-k
Copy link

ronaldvb-k commented Jul 10, 2024

There seems to be an inconsistency between the azapi and azurerm providers when setting use_aks_workload_identity to true.
We enable AKS Workload Identity on K8s jobs which runs terraform by adding the azure.workload.identity/use: "true" label.

Pods with this label are mutated by the azure-workload-identity mutating admission webhook to inject the following Azure specific environment variables:

AZURE_CLIENT_ID: xxx
AZURE_TENANT_ID: xxx
AZURE_FEDERATED_TOKEN_FILE:  /var/run/secrets/azure/tokens/azure-identity-token
AZURE_AUTHORITY_HOST=https://login.microsoftonline.com/

This works fine with the azurerm provider because it uses the AZURE_CLIENT_ID & AZURE_TENANT_ID environment variables when use_aks_workload_identity is set to true.

But it does not work with the azapi provider because this provider is using the ARM_CLIENT_ID & ARM_TENANT_ID environment variables as you can see here.

Should we change the azapi provider code, to make it use the AZURE_CLIENT_ID & AZURE_TENANT_ID environment variables when use_aks_workload_identity is set to true?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants