colossal-room-15708
11/12/2023, 11:00 AM3.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
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.3.40.2
export ...
is not enough it seemspurple-printer-9748
11/12/2023, 12:35 PMAZURE_STORAGE_ACCOUNT
AZURE_STORAGE_KEY
PULUMI_CONFIG_PASSPHRASE
and I was using exportadorable-area-44034
11/12/2023, 1:09 PMaz
version changed somewhere along the way? 🤔purple-printer-9748
11/12/2023, 1:15 PMaz version
"azure-cli": "2.53.1",
"azure-cli-core": "2.53.1",
adorable-area-44034
11/12/2023, 1:30 PMaz
and pulumi
etc...colossal-room-15708
11/12/2023, 9:21 PMdocker 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#
export AZURE_STORAGE_ACCOUNT=""
export AZURE_STORAGE_KEY=""
export PULUMI_CONFIG_PASSPHRASE=""
pulumi login <azblob://state>
(with the correct values of course)purple-printer-9748
11/13/2023, 8:54 AMaz login
?colossal-room-15708
11/13/2023, 10:13 AMadorable-area-44034
11/13/2023, 12:50 PM#!/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. 🙂colossal-room-15708
11/13/2023, 10:40 PM