hashicorp / hashicorp/packer

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

Open
#12,758 3 comments 0 reactions 0 assignees View on GitHub
bug regression stage/accepted stage/needs-investigation
Dominant language
Go
Stars
15.8k
Forks
3.3k
PR merge metrics
PR metrics pending

Description

#### Community Note

* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue or have submitted a pull request, please leave a comment

When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.

#### Overview of the Issue

I'm trying to move away from using bundled plugins in Packer, but when I try to install using the required_plugins block or packer plugins install I get the below error. We are using a managed identity for authentication and don't received any error prior to not using bundled plugins

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

#### Reproduction Steps
Login to Azure using az cli:

```
az login --identity --username "client ID"
```

Use packer plugins command to install plugin:

```
packer plugins install github.com/hashicorp/azure
```

Or use below block in HCL for plugins:

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

Run Packer build:

```
packer build my-packer-build.pkr.hcl'
```

### Packer version

v1.10.0

### Simplified Packer Template

```
source "azure-arm" "ubuntu" {
use_azure_cli_auth = true
subscription_id = "${var.subscription_id}"
build_resource_group_name = "${var.resource_group}"

virtual_network_name = "${var.vnet}"
virtual_network_subnet_name = "${var.subnet}"
virtual_network_resource_group_name = "${var.resource_group}"

os_type = "Linux"
image_publisher = "Canonical"
image_offer = "0001-com-ubuntu-server-jammy"
image_sku = "22_04-lts-gen2"
vm_size = "Standard_DS2_v2"

azure_tags = {
Monitor = "Ignore"
}

shared_image_gallery_destination {
subscription = "${var.subscription_id}"
resource_group = "${var.resource_group}"
gallery_name = "${var.image_gallery}"
image_name = "${var.image_name}"
image_version = "${var.image_version}${var.build_id}"
replication_regions = ["UK South"]
storage_account_type = "Premium_LRS"
}
}

build {
sources = ["source.azure-arm.ubuntu"]
}
```

### Operating system and Environment details

OS, Architecture, and any other information you can provide about the
environment.

Running in an Azure DevOps pipeline using a self hosted agent

Ubuntu VM 22.04

### Log Fragments and crash.log files

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.