title | titleSuffix | description | ms.topic | ms.subservice | ms.manager | ms.author | author | monikerRange | ms.date |
---|---|---|---|---|---|---|---|---|---|
Azure DevOps CLI in a release pipeline |
Azure DevOps |
Learn how to create a release pipeline using Azure DevOps CLI |
how-to |
azure-devops-reference |
mijacobs |
chcomley |
chcomley |
azure-devops |
08/17/2020 |
[!INCLUDE version-eq-azure-devops]
To use the Azure DevOps CLI in a hosted agent using a Release Pipeline, execute the following steps:
-
Create a release pipeline.
-
Choose Empty job.
-
Choose Stage 1 to configure the stage.
-
Choose the Tasks page, and configure the job to use Hosted macOS in Agent Pools.
-
Choose the :::image type="icon" source="../media/icons/blue-add.png" border="false"::: plus icon to add another task and configure it as a PowerShell task. Enter Power into the search box to filter the list.
-
Add the script, either via file or inline. For the example, the script has been included inline.
For reference, here is the inline script:
$extensions = az extension list -o json | ConvertFrom-Json
$devopsFound = $False
foreach($extension in $extensions)
{
if($extension.name -eq 'azure-devops'){
$devopsFound = $True
}
}
if ($devopsFound -eq $False){
az extension add -n azure-devops
}