Hello :wave:, it looks like it's currently impossi...
# azure
c
Hello 👋, it looks like it's currently impossible to use Azure Blob Storage for storing Pulumi's State (I'm using Pulumi v3.122.0 with go v1.22.4). I'm hitting the same bug as described here: https://github.com/pulumi/pulumi/issues/15748. And it looks like the same bug was also present in 2021 https://github.com/pulumi/pulumi/issues/6596, where the fix was to use a fork of gocloud. Does anyone have an idea of any workarounds or how to fix this so that I can use Azure as backend?
l
We've been using Azure blob storage for Pulumi state for a few years without any difficulty. I'm not sure what's different about your scenario than what we're doing. Assuming the storage account and blob exist, here are the commands we use to point to the state:
Copy code
az login --tenant "{tenant guid}"
az account set --subscription "{subscription guid}"
$Env:PULUMI_CONFIG_PASSPHRASE="{stack-passphrase}"
$Env:AZURE_STORAGE_ACCOUNT="{storage-account-name}"
$Env:AZURE_STORAGE_KEY="{storage-account-key}"
pulumi login azblob://{state-blob-name}
pulumi whoami -v
pulumi stack ls
pulumi stack select {target-stack-name}
c
Hello, thank you for your message. I managed to perform all those above commands without any issues. The issue happens when Pulumi tries to write into 1 specific file inside the
.pulumi/.history
folder that is located on the Blob. In fact it succeeds into writing inside the Blob, but the error still appears in the end (and maybe that's ok if a user runs it, but that's not good in a pipeline) Here are the steps to reproduce what I'm doing: -
az login
# (select correct subscription) - export all environment variables (as per your example) -
pulumi login --cloud-url <azblob://myStorage>
- (
pulumi stack ls
,
pulumi stack init asd
etc. works fine.) - In my example I'm using python, create a project with the following 3 lines inside `___main___.py`:
Copy code
import pulumi
from pulumi_azure_native import resources
resource_group = resources.ResourceGroup('rg-test', location='francecentral', resource_group_name='rg-test'
- I then create a python virtual env (
python -m venv venv
). - Inside the virtual env, I install with pip the following packages:
pulumi>=3.0.0,<4.0.0
and
pulumi-azure-native>=2.0.0,<3.0.0
- I then run the code with
pulumi up
The infrastructure on Azure gets created fine, the state even gets updated inside my Blob Storage.. but still the error appears in the end (even though it managed to edit the Blob Storage). Notes: Using Python 3.10 and a virtual environment, inside WSL2
l
That's beyond my ability to offer any suggestions. Sorry.