actions: PULUMI_ACCESS_TOKEN must be set error when using azure blob as backend

What happened?

Hi,

I m trying to use azure blob as backend that is required by my organization, but i get error:

PULUMI_ACCESS_TOKEN must be set for login during non-interactive CLI sessions

i have this environment variables

env: AZCLI_VERSION: latest AZURE_WRITE: false DOTNET_VERSION: 7.0.x AZURE_REGION: norwayeast PULUMI_WORK_DIR: PulumiAzure PULUMI_STACK_NAME: dev DOTNET_ROOT: /usr/share/dotnet AZURE_HTTP_USER_AGENT: AZUREPS_HOST_ENVIRONMENT: AZURE_STORAGE_ACCOUNT: pulumistateaccountdev AZURE_CONTAINER_NAME: pulumistatecontainerdev AZURE_STORAGE_KEY: rI/otrVwLuo0WrV+GUC7V5azr23RVc56AewKt5wv10SLDnXqpH4I********** AZURE_STORAGE_SAS_TOKEN: se=.****************** ARM_USE_OIDC: true ARM_CLIENT_ID: *** ARM_TENANT_ID: *** ARM_SUBSCRIPTION_ID: ***

Configured range: ^3 /opt/hostedtoolcache/pulumi/3.77.1/x64/pulumi version v3.77.1 Pulumi version 3.77.1 is already installed on this machine. Skipping download Logging into azblob://pulumistatecontainerdev

/home/runner/work/_actions/pulumi/actions/v4/webpack:/pulumi-github-action/node_modules/@pulumi/pulumi/automation/errors.js:77 : new CommandError(result); ^ CommandError: code: -2 stdout: stderr: Command failed with exit code 255: pulumi stack select --stack dev --non-interactive error: PULUMI_ACCESS_TOKEN must be set for login during non-interactive CLI sessions err?: Error: Command failed with exit code 255: pulumi stack select --stack dev --non-interactive error: PULUMI_ACCESS_TOKEN must be set for login during non-interactive CLI sessions

at Object.createCommandError (/home/runner/work/_actions/pulumi/actions/v4/webpack:/pulumi-github-action/node_modules/@pulumi/pulumi/automation/errors.js:77:1)
at Object.<anonymous> (/home/runner/work/_actions/pulumi/actions/v4/webpack:/pulumi-github-action/node_modules/@pulumi/pulumi/automation/cmd.js:76:1)
at Generator.throw (<anonymous>)
at rejected (/home/runner/work/_actions/pulumi/actions/v4/webpack:/pulumi-github-action/node_modules/@pulumi/pulumi/automation/cmd.js:19:1)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

Expected Behavior

the pulumi state is not created in azure blob

Steps to reproduce

i use github action with azure cli

Output of pulumi about

Configured range: ^3 /opt/hostedtoolcache/pulumi/3.77.1/x64/pulumi version v3.77.1 Pulumi version 3.77.1 is already installed on this machine. Skipping download Logging into azblob://pulumistatecontainerdev

/home/runner/work/_actions/pulumi/actions/v4/webpack:/pulumi-github-action/node_modules/@pulumi/pulumi/automation/errors.js:77 : new CommandError(result); ^ CommandError: code: -2 stdout: stderr: Command failed with exit code 255: pulumi stack select --stack dev --non-interactive error: PULUMI_ACCESS_TOKEN must be set for login during non-interactive CLI sessions err?: Error: Command failed with exit code 255: pulumi stack select --stack dev --non-interactive error: PULUMI_ACCESS_TOKEN must be set for login during non-interactive CLI sessions

at Object.createCommandError (/home/runner/work/_actions/pulumi/actions/v4/webpack:/pulumi-github-action/node_modules/@pulumi/pulumi/automation/errors.js:77:1)
at Object.<anonymous> (/home/runner/work/_actions/pulumi/actions/v4/webpack:/pulumi-github-action/node_modules/@pulumi/pulumi/automation/cmd.js:76:1)
at Generator.throw (<anonymous>)
at rejected (/home/runner/work/_actions/pulumi/actions/v4/webpack:/pulumi-github-action/node_modules/@pulumi/pulumi/automation/cmd.js:19:1)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

Additional context

No response

Contributing

Vote on this issue by adding a 👍 reaction. To contribute a fix for this issue, leave a comment (and link to your pull request, if you’ve opened one already).

About this issue

  • Original URL
  • State: closed
  • Created a year ago
  • Comments: 17 (9 by maintainers)

Commits related to this issue

Most upvoted comments

If you updated that and added PULUMI_BACKEND_URL to the env section in the Pulumi action:

- uses: pulumi/actions@v4
    with:
      command: up
      github-token: ${{ secrets.GIT_ACCESS_TOKEN }}
      stack-name: ${{ env.PULUMI_STACK_NAME }}
      work-dir: ${{ env.PULUMI_WORK_DIR }}
      cloud-url: azblob://${{ env.AZURE_CONTAINER_NAME }}
      upsert: true
    env:
      ARM_USE_OIDC: true
      ARM_CLIENT_ID: ${{ secrets.ARM_CLIENT_ID }}
      ARM_TENANT_ID: ${{ secrets.ARM_TENANT_ID }}
      ARM_SUBSCRIPTION_ID: ${{ secrets.ARM_SUBSCRIPTION_ID }}
      PULUMI_BACKEND_URL: azblob://${{ env.AZURE_CONTAINER_NAME }}

That should work