Hi all, since this morning I get error: obtain su...
# azure
w
Hi all, since this morning I get error: obtain subscription() from Azure CLI: parsing json result from the Azure CLI: waiting for the Azure CLI: exit status 1: ERROR: Please run 'az login' to setup account. I update my azure cli to the latest version as well as the pulimi cli but to no avail. I also az logout and az login again. Any idea?
Found the problem, at first I did not get this warning after az login but now I do: You have logged into Microsoft Azure! You can close this window, or we will redirect you to the Azure CLI documentation in 1 minute. Announcements [Windows only] Starting in May 2023, Azure CLI will authenticate using the Web Account Manager (WAM) broker by default. To help us collect feedback on the new login experience, you may opt-in to use WAM by running the following commands:
az config set core.allow_broker=true
az account clear
az login
m
Oh, so
az login
started printing the WAM warning, and Pulumi doesn’t expect it when parsing the output?
m
Same issue for me in a CI / CD pipeline.
And locally as well
@melodic-tomato-39005 I think you are right. it seems a pretty annoying bug that could affect many people
m
Hi @millions-journalist-34868, your error shows that no subscription was set, though, not a parsing error. Same for @white-helicopter-55877’s, actually. We’ve had such a parsing error due to a message from
az
before, and it looked like this. Sorry if I’m missing something here. You’re saying this started after upgrading
az
? Or Pulumi, or both?
m
Hum. Maybe it's because I logged out locally. Would it be possible for the pulumi up to display this error just because I am not logged in with the azure CLI ? In my CI / CD pipeline however I don't know, maybe something not properly configured.
m
It looks like you were logged in but hadn’t selected a subscription. It is odd, though, that it would happen both locally and in CI. That being said, though, allow me to point out that we recommend service principal authentication for CI scenarios :)
m
In my CI I have an environment variable that points to my subscription. I have tried to use the OIDC authentication but obviously I failed.
m
And it worked until an upgrade, or some other change?
Sorry about OIDC, we can look into that as well, although next week.
m
No no it was a new pipeline so I guess the problem is on my side, some misconfiguration I guess. I am trying to use Nuke https://nuke.build/ with Pulumi on GitHub Actions. I will try with a service principal first maybe.
Sorry for the trouble as it is probably just some misconfiguration on my pipeline and my azure CLI connected to the wrong directory locally. As I saw someone with the same message, I thought it was a problem with the Pulumi CLI.
m
No problem. Feel free to reach out again.
m
Suppressing warnings in general can be handy for automation.
Copy code
az config set core.only_show_errors=true
176 Views