Recently acceptable tests in CI have been failing when I left behind some resources in the Packer team's shared test subscription, these resources, such as DTLs or Compute Galleries, have a unique name constraint on a subscription level. The way these tests were setup in https://github.com/hashicorp/packer-plugin-azure/pull/346 was done because of how Packer and Terraform handle environment variables. This leads to less confidence in actual CI failures caused by regressions.
To handle this I've introduced the ARM_RESOURCE_PREFIX environment variable, and added a script to pass variables into Terraform more cleanly, this script can be run in CI to make sure the required variables are set, and then run terraform apply with the environment variables as command line arguments.
Recently acceptable tests in CI have been failing when I left behind some resources in the Packer team's shared test subscription, these resources, such as DTLs or Compute Galleries, have a unique name constraint on a subscription level. The way these tests were setup in https://github.com/hashicorp/packer-plugin-azure/pull/346 was done because of how Packer and Terraform handle environment variables. This leads to less confidence in actual CI failures caused by regressions.
To handle this I've introduced the
ARM_RESOURCE_PREFIX
environment variable, and added a script to pass variables into Terraform more cleanly, this script can be run in CI to make sure the required variables are set, and then run terraform apply with the environment variables as command line arguments.Successful example run on this branch: https://github.com/hashicorp/packer-plugin-azure/actions/runs/8529791780/job/23367911714