hashicorp / hashicorp/packer-plugin-azure
Unable to use azure-arm builder with Azure Stack Hub
- Dominant language
- Go
- Stars
- 63
- Forks
- 103
- PR merge metrics
- No merged PRs in 30d
Description
When filing a bug, please include the following headings if possible. Any
example text in this template can be deleted.
#### Overview of the Issue
Trying to use packer to build an image on Azure Stack Hub and getting the error bellow after configuring the cloud_management_name and metadata_host parameters to point to the Azure Stack Hub management endpoint:
_ui error: Build 'azure-arm.autogenerated_1' errored after 2 milliseconds 645 microseconds: parameter 'resource' cannot be empty_
This issue seems to be solved on with these two commits:
https://github.com/hashicorp/go-azure-helpers/commit/3a5cb49c74ecb5245a8bbeaaa7340695b657809d
https://github.com/hashicorp/go-azure-helpers/commit/efc0630e1da55d24e559b44f7a8161aa1837e98d
These commits were introduced in version 0.47.0 of the go-azure-helper and packer-plugin-azure is still using version 0.16.5
https://github.com/hashicorp/packer-plugin-azure/blob/main/go.mod#L17
It appears that changing the packer-plugin-azure code to use version 0.47.0 of go-azure-helper should be enough to make work.
#### Reproduction Steps
1. Install or download the packer utility
2. Create an azure-arm pkr.hcl ensuring they contain the cloud_environment_name and metadata_host parameters with the right information to point to the Azure Stack Hub system information
3. Run packer build
4. build fails with the error above
### Plugin and Packer version
From `packer version`
Packer v1.8.4
Builtin plugin version and 1.3.1 version installed using _packer plugins install "github.com/hashicorp/azure"_
### Simplified Packer Buildfile
[CreateVM.pkr.hcl](https://gist.github.com/arturoliveira/d6357016badfb78fb8df9413cd6a0097)
### Operating system and Environment details
OS, Architecture, and any other information you can provide about the
environment.
Windows 11
Azure Stack Hub 1.2206.2.52
### Log Fragments and crash.log files
[packerlog.txt](https://gist.github.com/arturoliveira/7149c34afc9dbd3c7c9c0dfc86eb37ca)
Contributor guide
Research direction
Start by inspecting go.mod at the referenced dependency entry and compare the plugin's go-azure-helper version with the versions named in the issue. Reproduce the Azure Stack Hub build using the linked configuration and log, then verify that the azure-arm builder no longer reports that the resource parameter cannot be empty.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- azure, go
- Domain
- cloud, infrastructure
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100