hashicorp / packer-plugin-azure

Packer plugin for Azure Virtual Machine Image Builders
https://www.packer.io/docs/builders/azure
Mozilla Public License 2.0
47 stars 76 forks source link

False Positive Error returned for multiple subnets with virtual network #428

Open mschuchard opened 1 week ago

mschuchard commented 1 week ago

Overview of the Issue

AzureRM Builder plugin package

If a virtual_network_name value is assigned with multiple subnets associated with that vnet, then an error is correctly returned. If additionally the specific virtual_network_subnet_name value is assigned, then the same error is incorrectly returned. The error is no longer returned when the virtual_network_resource_group_name is assigned a value, which should not occur because the subnet is explicitly specified, and the error string even states that the resource group is correctly determined. I am unsure what is triggering the false positive on the error return, but adding an extraneous parameter with the same value that the plugin states it is correctly determining prevents the false positive error return.

Reproduction Steps

Assign values for virtual_network_name and virtual_network_subnet_name, but not virtual_network_resource_group_name. packer build <dir>

Plugin and Packer version

Packer 1.10.3 Plugin 2.1.6

Simplified Packer Buildfile

See reproduction steps section.

Operating system and Environment details

N/A

Log Fragments and crash.log files

See Overview section.