I am trying to create a simple azure devops pipeline to execute a pulumi preview, however, I am getting a
error: obtain subscription() from Azure CLI: parsing json result from the Azure CLI: waiting for the Azure CLI: exit status 1: ERROR: Please run 'az login' to setup account.
I only have one subscription but tried to still set it just to be sure.
I have setup a service connection azure subscription. Also added two variables; PULUMI_ACCESS_TOKEN and pulumi.access.token
Below is my yaml
trigger:
- main
variables:
- name: one
value: initialValue
pool:
vmImage: ubuntu-latest
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: '3.12.1'
displayName: 'set Python version'
- script: |
python -m pip install --upgrade pip
pip install -r requirements.txt
displayName: 'Install dependencies'
- script: 'curl -fsSL https://get.pulumi.com | sh'
displayName: 'Installing pulumi'
- script: 'pulumi login'
displayName: 'Authenticating pulumi'
env:
PULUMI_ACCESS_TOKEN: $(PULUMI_ACCESS_TOKEN)
- task: AzureCLI@2
inputs:
azureSubscription: '<subscription from service connection>'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: 'az account list'
- task: AzureCLI@2
inputs:
azureSubscription: '<subscription from service connection>'
scriptType: 'bash'
scriptLocation: 'inlineScript'
inlineScript: 'az account set --subscription <sub id>'
- task: Pulumi@1
inputs:
command: 'preview'
stack: 'dev'
Not sure what else I am missing. Appreciate any help. Thank you.