https://pulumi.com logo
#general
Title
# general
c

colossal-room-15708

11/12/2023, 11:00 AM
I upgraded my local pulumi version to
3.93.0
and something's not working with our Azure state backend. I realised that the environment variables don't seem to be working anymore for
pulumi login
, but
az login
eventually worked. However, every single pulumi command afterwards fails with
Copy code
pulumi whoami
error: unable to open bucket <azblob://state>: azureblob: Options.AccountName is required
Clearly, the fact that I was able to login before should mean that
Options.AccountName
is set. I tested this on Windows and also on WSL/Ubuntu.
same issue also happens on
3.40.2
turns out, if I don't pass the env vars on the command line, it doesn't work.
export ...
is not enough it seems
p

purple-printer-9748

11/12/2023, 12:35 PM
i am using this and didnt had problems, I think I'm up to date I will check once I get back on computer, but it might be tomorrow
so far I'm sure I used only those vars:
Copy code
AZURE_STORAGE_ACCOUNT
AZURE_STORAGE_KEY
PULUMI_CONFIG_PASSPHRASE
and I was using export
I'm at 3.92
a

adorable-area-44034

11/12/2023, 1:09 PM
Silly question, but has the
az
version changed somewhere along the way? 🤔
p

purple-printer-9748

11/12/2023, 1:15 PM
ok, so I checked again and still works on mentioned 3.92 at least preview works well... As for az cli, for me:
Copy code
az version

  "azure-cli": "2.53.1",
  "azure-cli-core": "2.53.1",
works well, after updating to 3.93, I even log out of az and pulumi than log back in, still works...
a

adorable-area-44034

11/12/2023, 1:30 PM
@colossal-room-15708 - it might be worth testing it in a controlled environment like a container or a vm, with matching versions for
az
and
pulumi
etc...
c

colossal-room-15708

11/12/2023, 9:21 PM
no luck on a brand new container
Copy code
docker run -it -v C:\development\argos\infra\:/infra --entrypoint bash pulumi/pulumi
root@75dc7b7deeb1:/# pulumi version
v3.93.0
root@75dc7b7deeb1:/# cd infra/
root@75dc7b7deeb1:/infra# bash pulumi-init.sh
Logged in to 75dc7b7deeb1 as root (<azblob://state>)
root@75dc7b7deeb1:/infra# pulumi whoami
error: unable to open bucket <azblob://state>: azureblob: Options.AccountName is required
root@75dc7b7deeb1:/infra#
pulumi-init.sh
Copy code
export AZURE_STORAGE_ACCOUNT=""
export AZURE_STORAGE_KEY=""
export PULUMI_CONFIG_PASSPHRASE=""
pulumi login <azblob://state>
(with the correct values of course)
p

purple-printer-9748

11/13/2023, 8:54 AM
I assume You are also logged in with correct subscription by
az login
?
@colossal-room-15708
c

colossal-room-15708

11/13/2023, 10:13 AM
yep, I am
ah, odd, tried again, now it works /shrug
a

adorable-area-44034

11/13/2023, 12:50 PM
It worked inside the container, or it worked like you usually use pulumi? btw, I would be more inclined to use
#!/usr/bin/env bash
at the top of
pulumi-init.sh
and then remove each `export`from that file and
chmod +x pulumi-init.sh
the file instead. Otherwise you may as well simply use
. ./pulumi-init.sh
or
source ./pulumi-init.sh
Which would keep those environment variables visible in your current shell. FYI: any environment variables set in the current shell are available in that shell and any subshell. Although anything exported in the subshell are NOT available to the calling shell when the subshell exits - nor are they able to be. That's a difference between
source
and a subshell that can bite you. 🙂
c

colossal-room-15708

11/13/2023, 10:40 PM
yeah, I think that's what got me (I should know better)
2 Views