Accessing variable groups in conditions

Advertisements I am having the following pipeline definition trigger: batch: true resources: repositories: – repository: templates type: git ref: refs/heads/master name: my-template variables: – group: deployment-branches extends: template: my-template.yml@templates parameters: ${{ if ne(variables[‘Build.Reason’], ‘PullRequest’) }}: deploy_stages: – ${{ if eq(variables[‘Build.SourceBranch’], variables[‘dev’]) }}: – dev – ${{ if startsWith(variables[‘Build.SourceBranch’], variables[‘test’]) }}: – test My variables are… Read More Accessing variable groups in conditions

List of string variable in azure devops pipeline

Advertisements I’m creating a simple pipeline to deploy my test azure functions, I can’t figure out why my list of strings in the variable throws this error: A sequence was not expected Below is the code that generates the error. trigger: – none variables: functionNames: – ‘Function1’ – ‘Function2’ stages: – template: ../Stage/build-stage.yml parameters: functionNames:… Read More List of string variable in azure devops pipeline

What is the easiest way to make Azure pipeline stage fail for debugging purposes

Advertisements I would like to make a given stage fail to test my conditions – stage: EnvironmentDeploy condition: and(succeeded()…) is it possible to make – stage to fail purposefully? >Solution : The easiest way I can think of is adding a job with a PowerShell script, and using the throw keyword to exit the script… Read More What is the easiest way to make Azure pipeline stage fail for debugging purposes

fatal: ambiguous argument 'HEAD^': unknown revision or path not in the working tree when using git diff

Advertisements I am trying to take out git diff of a particular file in a folder using below command on azure devops pipeline: git diff –name-only HEAD^ .\dev-artifacts.properties .\dev-artifacts.properties or git diff –name-status HEAD HEAD^ or git diff –name-only dev-artifacts.properties dev-artifacts.properties After running this command, I am getting below error: fatal: ambiguous argument ‘HEAD^’: unknown… Read More fatal: ambiguous argument 'HEAD^': unknown revision or path not in the working tree when using git diff

How to add 10 hrs in the Get-Date in azure cli task for Azure pipeline?

Advertisements I am using below and tried adding hrs without any luck. This returns time in UTC while I want the time in same format but 10 hrs ahead. – task: AzureCLI@2 name: date displayName: dateValue inputs: azureSubscription: ‘test’ scriptType: ‘pscore’ scriptLocation: ‘inlineScript’ inlineScript: | $date = $(Get-Date -Format yyyy-MM-dd’T’HH:mm:ss) echo "##vso[task.setvariable variable=date]$date" >Solution :… Read More How to add 10 hrs in the Get-Date in azure cli task for Azure pipeline?

Pass script argument in Azure DevOps Pipeline which run a Powershell Script

Advertisements Hi I have a simple Azure DevOps Pipeline trigger: – main pool: vmImage: ubuntu-latest steps: – task: AzurePowerShell@5 inputs: azureSubscription: ‘Azure-DevOps’ ScriptType: ‘FilePath’ ScriptPath: ‘az-ps-scripts/session-07/vnet/vnet.ps1’ ScriptArguments: ‘-RGNAME RunFmPp’ azurePowerShellVersion: ‘LatestVersion’ workingDirectory: ‘az-ps-scripts/session-07/vnet/’ As you can see it has a ScriptArguments: ‘-RGNAME RunFmPp’ and it runs vnet.ps1 script. But in fact, I do not know… Read More Pass script argument in Azure DevOps Pipeline which run a Powershell Script