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
73
votes
7 answers

how can I use IF ELSE in variables of azure DevOps yaml pipeline with variable group?

I'm trying to assign one of 2 values to a variable in addition to variable group and can't find the reference that how to use IF ELSE. Basically I need to convert this jerkins logic to azure DevOps. Jenkins if (branch = 'master') { env = 'a' }…
kevmando
  • 917
  • 1
  • 10
  • 17
47
votes
7 answers

Azure Pipelines - Is there a way to view the folder structure?

I'm struggling to picture the folder structure of azure pipelines. I know there are some implicit directories like: $(System.DefaultWorkingDirectory) $(Build.ArtifactStagingDirectory) Which are both folders on a specific build agent available from…
Cristian E.
  • 3,116
  • 7
  • 31
  • 61
45
votes
5 answers

Azure DevOps : how to disable CI trigger on a YAML template pipeline?

In template pipelines you can't place any trigger statement such as trigger: none as specified in Microsoft's docs to disable ci trigger, so I wonder how do you prevent these pipelines from being executed every time you update them or any other yaml…
28
votes
3 answers

Azure Pipelines YAML: Unexpected value 'variables'

I'm using Azure Pipelines as a part of Azure DevOps. I'm trying to define variables in my template file, because I need to use the same value multiple times. This is my stage-template.yml: parameters: - name: param1 type: string - name: param2 …
Draex_
  • 3,011
  • 4
  • 32
  • 50
26
votes
1 answer

Azure Pipelines : differences between PublishBuildArtifacts and PublishPipelineArtifact tasks?

I've noticed the existance of a PublishPipelineArtifact task but it is not clear to me if there is any functional difference from the older PublishBuildArtifacts task?
whatever
  • 2,492
  • 6
  • 30
  • 42
24
votes
2 answers

Azure DevOps - Clean build directory

I am using a self-hosted agent for running my build and release pipelines. A problem happens after I run a build and it fails due to an issue in the pipeline. The cloned branch from remote sits in the working directory. The second run also uses the…
Indrajeet Gour
  • 4,020
  • 5
  • 43
  • 70
22
votes
3 answers

How to allow an empty string for a runtime parameter?

I'm just starting to work with runtime parameters in Azure Pipelines and there's something I can't quite figure out. Considering this Azure Pipelines YAML: parameters: - name: deployEnvironment displayName: Select your target environment. type:…
Walter Vos
  • 436
  • 1
  • 3
  • 13
21
votes
1 answer

DotNetCoreCLI restore vs NuGetCommand restore

I am trying to understand the difference between the two nuget restore commands in Azure build pipeline: - task: NuGetCommand@2 inputs: restoreSolution: '$(solution)' and - task: DotNetCoreCLI@2 inputs: command: 'restore' projects:…
21
votes
2 answers

Azure Pipelines using YAML for multiple environments (stages) with different variable values but no YAML duplication

Let's suppose I have 3 environments on Azure: Dev, Test and Prod. I have the same pipeline for building and deploying the resources and the code for each one of the environments except for two differences: different trigger branch different…
20
votes
2 answers

AzurePipeline failing due to: The reference assemblies for .NETFramework,Version=v4.6.1 were not found

I have an Azure pipeline setup for my builds. I have been running into this issue recently and cannot figure out a way to fix this: ##[error]C:\Program Files\Microsoft Visual…
19
votes
2 answers

Assign specific agent on Azure DevOps YAML Pipelines

I am trying to assign a specific agent on my agent pool but I don't know how to do it. Does anyone know it? I tried with this but doesn't work: - stage: Deploy pool: alm-aws-pool agent.name: deploy-05-agent1
19
votes
4 answers

Conditional dependent job in Azure Devops YAML pipelines

I'm building a complex pipeline in yaml and I'm trying to create a dependency between two jobs such that the latter job runs after the former, but only if the former is set to run based on a parameter. I can't seem to wrap my head around whether…
Thomas
  • 1,512
  • 3
  • 12
  • 37
19
votes
6 answers

How to pass complex DevOps pipeline template parameter to script

In an Azure DevOps pipeline template, I am declaring a parameter as an array/sequence parameters: mySubscription: '' myArray: [] steps: - AzureCLI@2 inputs: azureSubscription: ${{ parameters.mySubscription }} scriptType: pscore …
GGirard
  • 1,145
  • 1
  • 13
  • 33
18
votes
6 answers

Can I substring a variable in Azure Pipelines?

I'm looking for a way to define a variable in my azure-pipelines.yml file where I can substring the 'Build.SourceVersion' -> Use the first 7 characters only. Seems like there is no build-in function that can do such string operations in the…
nikitz
  • 1,051
  • 2
  • 12
  • 35
18
votes
2 answers

Is it possible to cancel a Azure DevOps pipeline Job programmatically?

As it is possible to stop a single step in a Azure DevOps pipeline: echo "##vso[task.complete result=Succeeded;]DONE" See: https://github.com/microsoft/azure-pipelines-tasks/blob/master/docs/authoring/commands.md#task-logging-commands Is it also…
Matthias
  • 1,055
  • 2
  • 14
  • 26
1
2 3
91 92