-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Enhancement Request: azurerm backend authentication upgrade to match provider #34322
Description
Terraform Version
1.6.5Use Cases
I want to use az CLI service principal authentication in my CI / CD pipelines. I am able to do that with the upgraded authentication in the provider for plan and apply, but init does not support it for the azurerm backend.
I'd like to have a consistent authentication experience across all commands.
The original driver for this is running terraform test with OIDC auth. Since the Azure DevOps ID Token is only valid for 10 minutes and each test configures a new provider for each time it times out if there are a few tests in there.
Attempted Solutions
There is no solution other than using the existing mechanism to supply service principal credentials.
Proposal
Update the azurerm backend authentication code
to match the provider code.
References
For clarity, this is the line in v0.43.0 of the target library that explicitly breaks SP auth with CLI: https://github.com/hashicorp/go-azure-helpers/blob/202cb910fbce8b8a78fe6e40177569b6ad59e885/authentication/auth_method_azure_cli_token.go#L72
The target library has significantly changed since that version and that code no longer exists in there.
No response