Skip to content

add env vars and update docs #36922

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

Open
wants to merge 9 commits into
base: main
Choose a base branch
from

Conversation

jaredfholgate
Copy link
Contributor

@jaredfholgate jaredfholgate commented Apr 25, 2025

This PR adds new alternative environment variable to support Azure DevOps Pipelines when using the azurerm backend.

  • AZURESUBSCRIPTION_SERVICE_CONNECTION_ID: This is default env var spat out by the Azure DevOps Azure CLI Task and we want to use this by default if not explicitly supplied.
  • ARM_OIDC_AZURE_SERVICE_CONNECTION_ID_BACKEND and ARM_CLIENT_ID_BACKEND: These allow specifying an alternative service connection and client ID that the backend will use.

This opens up the possibility of using separate identities for state and provider with OIDC auth. It is possible in limited scenarios by using CLI flags, but because they are persisted to the plan file it breaks some scenarios of separate identity for plan and apply.

With these environment variable we should be able to support with env vars, which is not possible now:

  • Init: Identity 1
  • Plan: Identity 2 - read only (with Identity 1 for state)
  • Init: Identity 1
  • Apply: Identity 3 - read / write (with Identity 1 for state)

There is also an update to the backend docs to specify the least privilege role assignment required following testing.

Fixes: #34322 (comment) - There is a specific ask around using a separate credential for backend.

Target Release

1.12.x

CHANGELOG entry

  • This change is user-facing and I added a changelog entry.
  • This change is not user-facing.

@jaredfholgate jaredfholgate requested review from a team as code owners April 25, 2025 14:48
@jaredfholgate
Copy link
Contributor Author

@jackofallops I added one further docs fix I spotted in here, but it is ready to go as far as I am concerned. There are no breaking changes in here. Would be great to get this in.

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

Successfully merging this pull request may close these issues.

Enhancement Request: azurerm backend authentication upgrade to match provider
5 participants