{"id":57052,"date":"2019-07-11T01:23:33","date_gmt":"2019-07-11T09:23:33","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/devops\/?p=57052"},"modified":"2019-07-11T01:23:33","modified_gmt":"2019-07-11T09:23:33","slug":"create-and-manage-azure-pipelines-from-the-command-line","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/devops\/create-and-manage-azure-pipelines-from-the-command-line\/","title":{"rendered":"Create and manage Azure Pipelines from the command line"},"content":{"rendered":"<p>We recently introduced a <a href=\"https:\/\/devblogs.microsoft.com\/devops\/whats-new-with-azure-pipelines\/\">unified YAML experience in Azure Pipelines<\/a> where you can configure pipelines to do CI, CD or CI and CD together. Over the past few months we have been building capability to manage YAML backed pipelines from the command line to cater to developers who prefer working from the command line interface or require commands to automate set up and management. We are excited to announce the availability of <code>az pipelines<\/code> <a href=\"https:\/\/docs.microsoft.com\/cli\/azure\/ext\/azure-devops\/pipelines?view=azure-cli-latest\">command<\/a> in the <a href=\"https:\/\/docs.microsoft.com\/azure\/devops\/cli\/index?view=azure-devops\">Azure DevOps extension<\/a> for developers who want to create and manage YAML backed Azure Pipelines from the CLI. The <code>az pipelines<\/code> command group allows you to <code>create<\/code>, <code>delete<\/code>, <code>list<\/code>, <code>run<\/code>, <code>show<\/code> and <code>update<\/code> a pipeline, enabling you to manage pipelines effectively from the command line.<\/p>\n<h2>Create an Azure Pipeline from the command line<\/h2>\n<p>Interacting from the command line can get challenging by having to remember various parameters and keying it in properly. To make things simple, we have crafted the <code>az pipelines create<\/code> command by letting developers go from a Git repo to a pipeline through an easy to use interactive flow, eliminating any need to remember a bunch of parameters.<br \/>\n1&#46; To start, you need the Azure CLI with the Azure DevOps extension installed. Have a look at the <a href=\"https:\/\/docs.microsoft.com\/azure\/devops\/cli\/get-started\">Azure DevOps CLI &#8211; Get Started<\/a> documentation for details.<br \/>\n2&#46; Clone your Git repository and navigate to the repo directory.<br \/>\n3&#46; Run <code>az pipelines create<\/code>:<br \/>\n<code>az pipelines create --name \"Contoso.CI\"<\/code><br \/>\n4&#46; Follow the steps to set up the pipeline.<\/p>\n<p>Check out the <a href=\"https:\/\/docs.microsoft.com\/azure\/devops\/pipelines\/create-first-pipeline-cli?view=azure-devops\">documentation<\/a> for more details.<\/p>\n<p>You can also automate the entire pipeline creation process by providing a reference to a YAML file inside your repository. Picking up from the example above, imagine you had the completed YAML available in the repository; you can create the pipeline by simply running the command:<br \/>\n<code>az pipelines create --name \"Contoso.CI\" --yml-path \/azure-pipelines.yml<\/code><\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/devops\/wp-content\/uploads\/sites\/6\/2019\/07\/yamlRun.png\" alt=\"YAML run of pipeline\" \/><\/p>\n<h2>Manage Azure Pipeline runs<\/h2>\n<p>Once the pipeline is created, a pipeline run is triggered. You can use the <code>az pipelines runs<\/code> command group to manage pipelines runs. Use <code>az pipelines runs list<\/code> command to view all pipelines runs and <code>az pipelines runs show<\/code> command to view details pertaining to a particular run.<\/p>\n<p>The <code>az pipelines runs<\/code> command group also contains the <code>artifact<\/code> and <code>tag<\/code> command sub groups which are used to manage artifacts pertaining to a run or tag a run, respectively.<\/p>\n<p>Refer the <code>az pipelines runs<\/code> <a href=\"https:\/\/docs.microsoft.com\/cli\/azure\/ext\/azure-devops\/pipelines\/runs?view=azure-cli-latest\">command documentation<\/a> for details pertaining to usage and syntax.<\/p>\n<p>For DevOps professionals who prefer to work from the command line, the <code>az pipelines<\/code> commands let you manage Azure Pipelines right from the terminal, without having to navigate to the portal. If you have any changes you&#8217;d like or suggestions for features then we&#8217;d love your feedback in our <a href=\"https:\/\/github.com\/Azure\/azure-devops-cli-extension\">Azure DevOps extension GitHub Repo<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are excited to announce the availability of `az pipelines` command group in the Azure DevOps extension to manage YAML backed pipelines from the command line to cater to developers who prefer working from the command line interface or require commands to automate set up and management. <\/p>\n","protected":false},"author":1136,"featured_media":54294,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[224],"tags":[],"class_list":["post-57052","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-azure"],"acf":[],"blog_post_summary":"<p>We are excited to announce the availability of `az pipelines` command group in the Azure DevOps extension to manage YAML backed pipelines from the command line to cater to developers who prefer working from the command line interface or require commands to automate set up and management. <\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/57052","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/users\/1136"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/comments?post=57052"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/posts\/57052\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media\/54294"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/media?parent=57052"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/categories?post=57052"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/devops\/wp-json\/wp\/v2\/tags?post=57052"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}