https://pulumi.com logo
#dotnet
Title
# dotnet
f

fresh-lifeguard-12682

09/03/2020, 3:58 AM
I’m currently setting some config in my Azure Pipeline, I was wondering if you guys know a way to this in batches or in a different way.
Copy code
- task: Pulumi@1
  displayName: 'Set azure:location'
  inputs:
    command: 'config'
    args: 'set azure:location ${{ parameters.azureLocation }}'
    cwd: '$(Pipeline.Workspace)/${{ parameters.pulumiArtifactName }}'
    stack: '${{ parameters.pulumiStack }}'
    createStack: true
    loginArgs: '--cloud-url ${{ parameters.pulumiCloudUrl }}'

- task: Pulumi@1
  displayName: 'Set azureServiceBusConnectionString'
  inputs:
    command: 'config'
    args: 'set azureServiceBusConnectionString $(azureServiceBusConnectionString)'
    cwd: '$(Pipeline.Workspace)/${{ parameters.pulumiArtifactName }}'
    stack: '${{ parameters.pulumiStack }}'
    createStack: true
    loginArgs: '--cloud-url ${{ parameters.pulumiCloudUrl }}'

- ${{ if eq(parameters.setMongoConnectionString, 'true') }}:
  - task: Pulumi@1
    displayName: 'Set mongoConnectionString'
    inputs:
      command: 'config'
      args: 'set mongoConnectionString $(mongoConnectionString)'
      cwd: '$(Pipeline.Workspace)/${{ parameters.pulumiArtifactName }}'
      stack: '${{ parameters.pulumiStack }}'
      createStack: true
      loginArgs: '--cloud-url ${{ parameters.pulumiCloudUrl }}'
c

clever-sunset-76585

09/03/2020, 2:45 PM
Once the Pulumi CLI is installed in your build agent, you can simply use a
CmdLine
task to run regular
pulumi config set ...
commands. The Pulumi task extension currently doesn’t have an “install only” mode, but you could easily work around that by simply running the “stack” command first, then in the next step add one of these https://docs.microsoft.com/en-us/azure/devops/pipelines/tasks/utility/command-line?view=azure-devops&tabs=yaml
Copy code
# Command line
# Run a command line script using Bash on Linux and macOS and cmd.exe on Windows
- task: CmdLine@2
  inputs:
    script: |
      # Note that the build variables will need to use the env var syntax when accessing them inside a script task.
      pulumi config set ...
      pulumi config set ...
👍 1