I upgraded my local pulumi version to `3.93.0` an...
# general
c
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
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
Silly question, but has the
az
version changed somewhere along the way? 🤔
p
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
@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
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
I assume You are also logged in with correct subscription by
az login
?
@colossal-room-15708
c
yep, I am
ah, odd, tried again, now it works /shrug
a
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
yeah, I think that's what got me (I should know better)