Author : MD TAREQ HASSAN | Updated : 2021/10/27

Create YAML Files

azure-pipelines-pulumi-up.yml

pool:
  vmImage: 'ubuntu-latest'

#
# Import KeyVault secrets by linking Variable Group
#
variables:
- group: "pulumi-secrets-vg"

jobs:
- job: PulumiUpJob
  displayName: Pulumi Up Job
  steps:
  - task: UseDotNet@2
    displayName: 'Use .NET 6.0 sdk'
    inputs:
      packageType: 'sdk'
      version: '6.0.x'
      includePreviewVersions: true
  - task: Pulumi@1
    inputs:
      azureSubscription: 'xxx-sc' # sc -> service connection
      command: up
      loginArgs: 'azblob://pulumi-backend-container'
      args: '--yes'
      stack: dev
    env:
      AZURE_STORAGE_ACCOUNT: $(AZURE-STORAGE-ACCOUNT)
      AZURE_STORAGE_KEY: $(AZURE-STORAGE-KEY)
      AZURE_CLIENT_ID: $(AZURE-CLIENT-ID)
      AZURE_CLIENT_SECRET: $(AZURE-CLIENT-SECRET)
      AZURE_TENANT_ID: $(AZURE-TENANT-ID)

azure-pipelines-pulumi-destroy.yml

pool:
  vmImage: 'ubuntu-latest'

#
# Import KeyVault secrets by linking Variable Group
#
variables:
- group: "pulumi-secrets-vg"

jobs:
- job: PulumiDestroyJob
  displayName: Pulumi Destroy Job
  steps:
  - task: Pulumi@1
    inputs:
      azureSubscription: 'xxx-sc' # sc -> service connection
      command: destroy
      loginArgs: 'azblob://pulumi-backend-container'
      args: '--yes'
      stack: dev
    env:
      AZURE_STORAGE_ACCOUNT: $(AZURE-STORAGE-ACCOUNT)
      AZURE_STORAGE_KEY: $(AZURE-STORAGE-KEY)
      AZURE_CLIENT_ID: $(AZURE-CLIENT-ID)
      AZURE_CLIENT_SECRET: $(AZURE-CLIENT-SECRET)
      AZURE_TENANT_ID: $(AZURE-TENANT-ID)

Create Pipelines

Azure DevOps YAML Pipeline - Multiple Pipelines form Multiple YAML Files Step 1

Azure DevOps YAML Pipeline - Multiple Pipelines form Multiple YAML Files Step 2

Azure DevOps YAML Pipeline - Multiple Pipelines form Multiple YAML Files Step 3

Azure DevOps YAML Pipeline - Multiple Pipelines form Multiple YAML Files Step 4

Azure DevOps YAML Pipeline - Multiple Pipelines form Multiple YAML Files Step 5

Azure DevOps YAML Pipeline - Multiple Pipelines form Multiple YAML Files Step 6

Azure DevOps YAML Pipeline - Multiple Pipelines form Multiple YAML Files Step 7

Azure DevOps YAML Pipeline - Multiple Pipelines form Multiple YAML Files Step 8