Azure authentication failing, when using az cli auth type, with error getting authenticated object ID

This occurs after I upgrade my project from 1.27 version of azurerm provider to version 2.9.0. The full error message is below. All I have to do get this to work once again is pin the version of the provider to 1.27 and comment out the features {} block, which was introduced in the newer version of the provider; then simply run terraform init. After terraform init completes I’m then able to run a plan or apply as expected. Is anyone else experiencing this problem? I can’t seem to find a solution using the Googles.

Error building account: Error getting authenticated object ID: Error parsing json result from the Azure CLI: Error waiting for the Azure CLI: exit status 1

on main.tf line 1, in provider “azurerm”:

I am running into the same problem. Followed your instruction to downgrade to 1.27 and terraform plan works. Thank you for that suggestion. Any one have any other ideas to get a true resolution?

It seems that the issue is not related with the provider version but with the AZ CLI 2.37.0. I guess, you will need to downgrade the AZ CLI version until the provider is not upgraded for using ‘id’ instead of ‘objectID’. Here’s the reference: Microsoft Graph migration | Microsoft Docs

Another reference: `az ad` returns a Graph object without `objectId` property · Issue #22328 · Azure/azure-cli · GitHub