Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Explicit setting of subscription_id is ignored when using use_azure_cli_auth #461

Open
DevopsMercenary opened this issue Jan 7, 2025 · 0 comments · May be fixed by #465
Open

Explicit setting of subscription_id is ignored when using use_azure_cli_auth #461

DevopsMercenary opened this issue Jan 7, 2025 · 0 comments · May be fixed by #465
Labels

Comments

@DevopsMercenary
Copy link

DevopsMercenary commented Jan 7, 2025

Overview of the Issue

I do understand from what I've read that when using use_azure_cli_auth the local user's current subscription is being used.

for instance, if my current 'default' subscription is xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx then packer tries to use the image URL of SourceImageName: '/subscriptions/xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxproviders/Microsoft.Compute/locations/eastus2/publishers/MicrosoftWindowsDesktop/ArtifactTypes/vmimage/offers/Windows-10/skus/win10-22h2-ent-g2/versions/latest'
OR looks for the Vnet I've set in the wrong subscription.

but I've explicitly set the subscription_id and I would expect that setting the subscription_id would tell packer, that no I don't want the default/current subscription but rather I really want you to use the one I've provided.

These are for local test packer builds when I'm testing

Reproduction Steps

packer build .

Plugin and Packer version

Packer v1.11.2

~/.config/packer/plugins/github.com/hashicorp/ansible/packer-plugin-ansible_v1.1.2_x5.0_darwin_arm64
~/.config/packer/plugins/github.com/hashicorp/azure/packer-plugin-azure_v2.2.0_x5.0_darwin_arm64
~/.config/packer/plugins/github.com/joomcode/external/packer-plugin-external_v0.0.3_x5.0_darwin_arm64

Simplified Packer Buildfile


source "azure-arm" "default" {

   use_azure_cli_auth = true

  image_offer     = "Windows-10"
  image_publisher = "MicrosoftWindowsDesktop"
  image_sku       = "win10-22h2-ent-g2"

  subscription_id       =  "aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa"
  virtual_network_resource_group_name = "operations-devops-vnet"
  virtual_network_name = "operations-devops-vnet"
  virtual_network_subnet_name = "image-builder"

}

Operating system and Environment details

MacOS Sonoma 14.7.2

Log Fragments and crash.log files

https://gist.github.com/DevopsMercenary/422c8eff546ec79f286ddb569ffc1d65

@mogrogan mogrogan linked a pull request Jan 23, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant