Creates a pipeline definition in Azure DevOps from a YAML file.
Input Schema
| Property | Type | Description | Required |
|---|---|---|---|
| host | string | - | |
| token | string | - | |
| branch | string | - | |
| project | string | - | |
| repository | string | - | |
| organization | string | - | |
| pipelineName | string | - | |
| pipelineFolder | string | - | |
| pipelineYamlFile | string | - | |
| pipelineAgentPoolName | string | - |
Output Schema
| Property | Type | Description | Required |
|---|---|---|---|
| pipelineId | string | - | |
| pipelineUrl | string | - |
Usage Examples
Create a CI pipeline from a root azure-pipelines.yml
Creates a simple CI pipeline for an existing Azure DevOps repo using the YAML file at the repository root. Use this when the repository already contains azure-pipelines.yml on the default branch.
steps:
- id: fetch-template
action: fetch:template
input:
url: https://github.com/acme-org/templates/react-app/archive/main.zip
targetPath: .
values:
name: ${{ parameters.repoName }}
- id: create-pipeline
action: azure:pipeline:create
input:
organization: contoso
project: retail
repository: web-frontend
pipelineName: web-frontend CI
pipelineYamlFile: azure-pipelines.yml
- id: log-pipeline
action: debug:log
input:
message: Created pipeline at ${{ steps['create-pipeline'].output.pipelineUrl }} with ID ${{ steps['create-pipeline'].output.pipelineId }}Create a pipeline on Azure DevOps Server with a custom folder and agent pool
Targets an on‑prem Azure DevOps Server instance, placing the pipeline under a folder and assigning a self‑hosted agent pool. Use this when you need to organize pipelines and control the execution environment.
steps:
- id: fetch-template
action: fetch:template
input:
url: https://git.corp.local/acme/templates/java-service.git
targetPath: .
values:
serviceName: inventory-service
- id: create-pipeline
action: azure:pipeline:create
input:
host: ado.corp.local
organization: DefaultCollection
project: Engineering
repository: inventory-service
pipelineName: inventory-service CI
pipelineYamlFile: .ado/pipelines/ci.yml
pipelineFolder: Services/Inventory
pipelineAgentPoolName: Linux-Self-Hosted
token: ${{ secrets.ado_pat }}
- id: log
action: debug:log
input:
message: Pipeline URL ${{ steps['create-pipeline'].output.pipelineUrl }}Create a monorepo pipeline pointing to a YAML file in a subdirectory
Creates a pipeline for a monorepo using a YAML file stored under .azure/pipelines and binds it to the develop branch. Use this when each service in a monorepo owns its own pipeline YAML.
steps:
- id: fetch-template
action: fetch:template
input:
url: https://github.com/acme-org/templates/node-service/archive/main.zip
targetPath: .
values:
serviceId: service-a
- id: create-pipeline
action: azure:pipeline:create
input:
organization: acme-org
project: platform
repository: platform-monorepo
pipelineName: service-a CI
pipelineYamlFile: .azure/pipelines/service-a-ci.yml
branch: develop
pipelineFolder: Services/ServiceA
- id: debug
action: debug:log
input:
message: Monorepo pipeline created ${{ steps['create-pipeline'].output.pipelineUrl }}Create a pipeline using a token from template parameters
Passes a Personal Access Token from template parameters and sets the host explicitly. Use this when the Backstage integration is not configured and you need to supply credentials at runtime.
steps:
- id: fetch-template
action: fetch:template
input:
url: https://github.com/acme-org/templates/go-service/archive/main.zip
targetPath: .
values:
repoName: ${{ parameters.repoName }}
- id: create-pipeline
action: azure:pipeline:create
input:
host: dev.azure.com
organization: ${{ parameters.organization }}
project: ${{ parameters.project }}
repository: ${{ parameters.repoName }}
pipelineName: ${{ parameters.repoName }} CI
pipelineYamlFile: build/azure-pipelines.yml
token: ${{ parameters.azurePat }}
- id: log
action: debug:log
input:
message: Pipeline ${{ steps['create-pipeline'].output.pipelineId }} created for repo ${{ parameters.repoName }}Create a release pipeline in a folder with a specific branch and Windows agent pool
Creates a pipeline for a release branch and stores it under a Releases folder, targeting a Windows agent pool. Use this for release builds that require Windows tooling.
steps:
- id: fetch-template
action: fetch:template
input:
url: https://github.com/acme-org/templates/dotnet-api/archive/main.zip
targetPath: .
values:
projectName: orders-api
- id: create-pipeline
action: azure:pipeline:create
input:
organization: contoso
project: commerce
repository: orders-api
pipelineName: orders-api Release
pipelineYamlFile: pipelines/release.yml
branch: release/2025.10
pipelineFolder: Releases/API
pipelineAgentPoolName: Windows
token: ${{ secrets.azure_devops_pat }}
- id: show
action: debug:log
input:
message: Release pipeline created at ${{ steps['create-pipeline'].output.pipelineUrl }}Note
- Replace secrets and parameters with your own values
- The examples assume you have a repository in Azure DevOps and the referenced YAML file is committed in the specified branch
Related actions