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

az account-get-acccess-token fails #434

Open
Binternet opened this issue Jul 28, 2024 · 1 comment
Open

az account-get-acccess-token fails #434

Binternet opened this issue Jul 28, 2024 · 1 comment

Comments

@Binternet
Copy link

Binternet commented Jul 28, 2024

Overview of the Issue

I am using azure-cli to as the auth procedure.

yet az get-access-token fails due to unknown --scope argument

Reproduction Steps

run packer build with azure-arm builder using the same versions which I use.

Plugin and Packer version

packer v1.11.1 [go1.21.10 windows amd64
azure-plugin v2.1.7_x5.0_windows_amd64

Operating system and Environment details

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

Log Fragments and crash.log files

machine readable: azure-arm.example, error []string{"running azure CLI: exit status 2: ERROR: unrecognized arguments: --scope https://management.azure.com/.default\r\n\r\nTRY THIS:\r\nhttps://aka.ms/cli_ref\r\nRead more about the command in the reference docs"}

@Binternet Binternet added the bug label Jul 28, 2024
@JenGoldstrich
Copy link
Contributor

JenGoldstrich commented Aug 29, 2024

Hey @Binternet I was unable to reproduce this, I tried both the latest versions of packer and the Azure plugin and the ones you specified, on Windows (10) using powershell and cmd. I was able to successfully build Azure packer templates using CLI auth.

What is the terminal environment this is running in? (Powershell, cmd, etc), and can I get the output of your build with the environment variable PACKER_LOG set to 1 (this enables verbose logging)

Could you also run az account get-access-token --scope https://management.azure.com/.default --tenant your-tenant-id -o=json from the same terminal session and let me know if that works and returns a token?

The current version of the Azure CLI definitely supports the scope argument, but maybe there's a weird parsing issue happening with that argument (since it includes the scope url (the argument's value) in the error message 🤔

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants