You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Claranet terraform-wrapper relies on the Python SDK azure-cli-core lib to retrieve a CLI Azure session.
This session is used to:
check if the Azure session is correct, has the correct rights to access the target Azure Subscription
use this session when Azure bakend is used, to get Azure Storage Account keys (and forward them to Terraform)
terraform-wrapper v8.1.2 depends on azure-cli-core v2.29.0 which uses ADAL library for Azure authentication. (Session tokens are stored in the $AZURE_CONFIG_DIR/accessTokens.json file.
With azure-cli and azure-cli-core v2.30.0, Microsoft has introduced a CORE breaking change: they now uses MSAL library for Azure authentication. (See Changelog info: https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/docs-ref-conceptual/release-notes-azure-cli.md#core)
Session tokens are now stored in $AZURE_CONFIG_DIR/msal_token_cache.json file.
Issue description: First case:
You have a valid Azure session, generated via azure login command and using azure-cli v2.29 (or anterior version)
You now upgrade to azure-cli v2.30.0 (or more recent)
If you trigger a tfwrapper command (like tfwrapper plan):
The init phase will success: tfwrapper will rely on the Azure session available via azure-ci-core v2.29 and ADAL lib
The plan phase will crash with an error message from Terraform:
Error: building account: getting authenticated object ID: Error parsing json result from the Azure CLI: Error waiting for the Azure CLI: exit status 1: ERROR: User aaaa.bbbb@fr.clara.net does not exist in MSAL token cache. Run `az login`.
│
│ with provider["registry.terraform.io/hashicorp/azurerm"],
│ on main.tf line 1, in provider "azurerm":
│ 1:provider"azurerm" {
You need to run again az login with azure-cli v2.30+, so you will have both ADAL and MSAL Azure sessions.
Second Case:
You're on a fresh install of azure-cli v2.30.0, you do an az login command
Because this has genererated a MSAL session, tfwrapper will directly fail with:
ERROR tfwrapper : Error while getting Azure token, check that you are authorized on this subscription then log yourself in with:
AZURE_CONFIG_DIR=/home/xxxxxxxxxxxx/.run/azure az login
because tfwrapper cannot find the ADAL session.
The text was updated successfully, but these errors were encountered:
Context:
Claranet terraform-wrapper relies on the Python SDK
azure-cli-core
lib to retrieve a CLI Azure session.This session is used to:
terraform-wrapper v8.1.2 depends on azure-cli-core v2.29.0 which uses ADAL library for Azure authentication. (Session tokens are stored in the
$AZURE_CONFIG_DIR/accessTokens.json
file.With azure-cli and azure-cli-core v2.30.0, Microsoft has introduced a CORE breaking change: they now uses MSAL library for Azure authentication. (See Changelog info: https://github.com/MicrosoftDocs/azure-docs-cli/blob/main/docs-ref-conceptual/release-notes-azure-cli.md#core)
Session tokens are now stored in
$AZURE_CONFIG_DIR/msal_token_cache.json
file.Issue description:
First case:
azure login
command and using azure-cli v2.29 (or anterior version)tfwrapper
command (liketfwrapper plan
):You need to run again
az login
withazure-cli
v2.30+, so you will have both ADAL and MSAL Azure sessions.Second Case:
az login
commandbecause tfwrapper cannot find the ADAL session.
The text was updated successfully, but these errors were encountered: