Questions tagged [azure-pipelines-yaml]

Azure Pipelines automatically builds and tests code projects to make them available to others. It works with just about any language or project type. Azure Pipelines combines continuous integration (CI) and continuous delivery (CD) to test and build your code and ship it to any target. YAML (or YML) is the language used to construct pipeline objects.

1379 questions
9
votes
2 answers

Execute or not template in Azure Pipeline with runtime condition

I have got an Azure Pipeline already running. Now I want to execute a sequence of steps only if a certain condition becomes true during runtime. Example steps: - template: steps_checkout.yml # some more steps here - bash: | if [ some…
maze
  • 789
  • 1
  • 7
  • 31
8
votes
2 answers

How to write if else condition in Azure DevOps Pipeline

I have an azure pipeline and run with parameters where I've multiple options like below: Select Test Execution Product Product with Cost Product with Attachments If I select Product then I execute product.js file, if I select Product with Cost…
8
votes
1 answer

YAML Variables, can you reference variables within variables?

I am using a variables.yml file as a template to store different variables, and I was curious if I am able to reference variables within the yml file itself to essentially nest them. For example: #variables.yml file variables: food1: …
aseb
  • 274
  • 2
  • 11
8
votes
1 answer

Azure pipeline yml: how to print out value of a variable

It seems that name is a special magic variable that somehow gets used for my output directory. (Is this behavior documented anywhere?) I'm trying to set it. Given the extraordinary difficulty of writing Azure pipeline yml, it's highly unlikely that…
8
votes
1 answer

Can parameters be defined in one YAML file and reused in another?

TL;DR Is it possible to have a parameter and its values in a template YAML and have the main YAML read the list and present them in a drop-down when preparing to run a pipeline? Very similar to the MS example of "Variable reuse", shown here. # File:…
woter324
  • 2,608
  • 5
  • 27
  • 47
8
votes
1 answer

Install multiple Azure DevOps environment agents on server

We have a dev server hosting webservices from multiple Azure DevOps projects. To use yaml deployment pipelines, we migrated from deployment pools to environments/resources. Unlike deployment pools neither environments nor resources can be shared…
8
votes
3 answers

Azure pipelines submodules clone failed

I created main project https://dev.azure.com/GilbertHsu/pipeline_test with 3 projects as submodules in the main…
7
votes
3 answers

How to loop through user-defined variables in a YAML pipeline?

I am trying to loop through user-defined variables in an Azure DevOps YAML pipeline. The variables have been created through the UI: Below the YAML pipeline code that I'm using: trigger: - dev - main pr: - dev pool: vmImage:…
Chris
  • 935
  • 3
  • 10
  • 21
7
votes
2 answers

How to set Azure DevOps yaml variables conditionally based on parameter value

I am trying to set variables based on a parameter value in a yaml pipeline. It seems that I've read many other posts which show examples like the one below that the authors have said worked, but I cannot get past issues when trying to do something…
Mike
  • 1,010
  • 1
  • 14
  • 33
7
votes
2 answers

Why does Azure Pipelines say "The environment does not exist or has not been authorized for use"?

In Azure Pipelines YAML, you can specify an environment for a job to run in. jobs: - deployment: Deploy displayName: Deploy environment: $(environment) Passing a new value to the pipeline should automatically create the…
7
votes
2 answers

How to delete Azure pipeline artifacts after it's finished?

I have the following pipeline structure: Job A --> Generate build files Parallel: Job B --> Uses the build files Job C --> Uses the build files Job D --> Publishes the build files Job E --> Release On finish, I want to delete the build files…
7
votes
1 answer

PublishPipelineArtifact is deprecated - Publish a local directory or file as a named artifact for the current pipeline

I have the following Azure Pipelines job: - stage: Production dependsOn: Test jobs: - job: Publish pool: vmImage: 'Ubuntu 16.04' steps: - task: UseDotNet@2 displayName: Setup inputs: packageType: sdk …
Miguel Moura
  • 36,732
  • 85
  • 259
  • 481
7
votes
5 answers

Execute Azure Devops job on a pool based on conditional parameter

I am trying to execute an Azure Devops Job on a specific pool based on a condition. The goal is to switch between self-hosted agent and microsoft agent. Here is the configuration: parameters: custom_agent: true jobs: - job: Test …
7
votes
2 answers

Use runtime variable for repository name in checkout in Azure Pipelines

I have a matrix in a multi-stage pipeline that generates jobs to go and checkout to different git repositories and make commits. The matrix has the repo name as a value, and I want to reference that during a checkout task. However I keep getting…
7
votes
1 answer

Trigger CI specific branch and exclude other branches in Azure-Pipelines.YML Problem

I'm trying to create an azure pipeline which triggers on changes in a specific branch but exclude other branches. The sample scenario is, I have multiple branches like dev, test, beta branches. So I have this sample configuration in my…
1 2
3
91 92