Error when moving away from bundled plugins - Tenant shouldn't be specified for managed identity account

Hi!

When trying to move away from bundled plugins I’m getting the below error

‘running Azure CLI: exit status 1: ERROR: Tenant shouldn’t be specified for managed identity account’

Currently using az login --identity --username “clientID” to login to Azure and specifying use_azure_cli_auth = true in my HCL file

Had no issues with this before attempting to move away from the bundled plugins

Any help is appreciated, thanks!

Hi @dkerins thank you for bubbling this up and for opening an issue on the GitHub tracker. This looks like a bug for sure. I left a comment on the issue with details on what might be happening.

But the tl;dr is that the latest Azure plugin v2.0.0 behaves differently when specifying use_azure_cli_auth. For Azure VMs running Packer builds, if possible, I recommend trying to use a managed system identity for auth by removing the use_azure_cli_auth attribute from your configuration or you can downgrade the plugin version to v1.4.5 to use the version of the plugin that was previously bundled into Packer while we work on a fix.

packer {
    required_plugins {
        azure = {
            version = ">= 1.4.5"
            source  = "github.com/hashicorp/azure"
        }
    }
}

I will continue to update the GitHub issue with our findings and progress.