From 9695dcf983f2412fd26445770972202bb47a9a56 Mon Sep 17 00:00:00 2001 From: George Verghese <16950956+geverghe@users.noreply.github.com> Date: Wed, 26 Jun 2019 10:18:01 +0530 Subject: [PATCH] Fix Samples.md with correct usage of PAT in Azure Pipelines (#694) * Fixing incorrect PAT Variable ref * Fixes for Github issues - 692, 518 --- doc/samples.md | 38 ++++++++++---------------------------- 1 file changed, 10 insertions(+), 28 deletions(-) diff --git a/doc/samples.md b/doc/samples.md index 721ac12d..fcfcac9a 100644 --- a/doc/samples.md +++ b/doc/samples.md @@ -151,7 +151,7 @@ if ($devopsFound -eq $False){ ### Use the Azure DevOps Extension with YAML -If you prefer to use YAML to provide your release pipeline configuration, you can use the following example to understand how YAML can be used to install Azure CLI and add the Azure DevOps extension. +If you prefer to use YAML, you can use the following example to understand how YAML can be used to install Azure CLI and add the Azure DevOps extension. In the example, you will learn how to add the Azure DevOps extension to Azure CLI and run the build and PR list commands on Linux, Mac OS and Windows hosted agents @@ -164,17 +164,11 @@ steps: - script: az extension add -n azure-devops displayName: 'Install Azure DevOps Extension' -- script: echo ${AZURE_DEVOPS_CLI_PAT} | az devops login - env: - AZURE_DEVOPS_CLI_PAT: $(System.AccessToken) - displayName: 'Login Azure DevOps Extension' - -- script: az devops configure --defaults organization=$(System.TeamFoundationCollectionUri) project=$(System.TeamProject) --use-git-aliases yes - displayName: 'Set default Azure DevOps organization and project' - - script: | az pipelines build list - git pr list + az repos pr list + env: + AZURE_DEVOPS_EXT_PAT: $(System.AccessToken) displayName: 'Show build list and PRs' ``` @@ -202,17 +196,11 @@ steps: - script: az extension add -n azure-devops displayName: 'Install Azure DevOps Extension' - - script: echo ${AZURE_DEVOPS_CLI_PAT} | az devops login - env: - AZURE_DEVOPS_CLI_PAT: $(System.AccessToken) - displayName: 'Login Azure DevOps Extension' - - - script: az devops configure --defaults organization=https://georgeverghese.visualstudio.com project="Movie Search Web App" --use-git-aliases yes - displayName: 'Set default Azure DevOps organization and project' - - script: | az pipelines build list - git pr list + az repos pr list + env: + AZURE_DEVOPS_EXT_PAT: $(System.AccessToken) displayName: 'Show build list and PRs' ``` @@ -240,17 +228,11 @@ steps: - script: az extension add -n azure-devops displayName: 'Install Azure DevOps Extension' - - script: echo $(System.AccessToken) | az devops login - env: - AZURE_DEVOPS_CLI_PAT: $(System.AccessToken) - displayName: 'Login Azure DevOps Extension' - - - script: az devops configure --defaults organization=https://georgeverghese.visualstudio.com project="Movie Search Web App" --use-git-aliases yes - displayName: 'Set default Azure DevOps organization and project' - - script: | az pipelines build list - git pr list + az repos pr list + env: + AZURE_DEVOPS_EXT_PAT: $(System.AccessToken) displayName: 'Show build list and PRs' ```