azure-devops-cli-extension icon indicating copy to clipboard operation
azure-devops-cli-extension copied to clipboard

Cannot create a pipeline with yaml file from another Project

Open jwikman opened this issue 4 years ago • 5 comments

Cannot create a pipeline with yaml file from a repo in another Project

Command Name az pipelines create Extension Name: azure-devops. Version: 0.18.0.

Errors:

request failed: Operation returned a 404 status code.

To Reproduce:

Steps to reproduce the behavior. Note that argument values have been redacted, as they may contain sensitive information.

  • Create Azure DevOps Project1 and Project2
  • Create repository Repo1 in Project1
  • Add a yaml pipeline definition in Repo1
  • run az pipelines create to create a pipeline in Project2 with yaml pipeline from Project1/Repo1. Use the git clone url as repository parameter
    • Note that argument values have been replaced by {}
    • az pipelines create --name {} --org {} --project {} --repository {} --yml-path {} --branch {} --output {} --skip-first-run {} --debug

The 404 error seems to come from a http GET to list repos, and it tries to list Repo1 in Project2 hence the 404 (file not found) error: GET https://dev.azure.com/[org]/[Project2]/_apis/git/repositories/[Repo1]

Expected Behavior

The pipeline should be created in Project2, but the yaml pipeline definition will stay in Repo1 in Project1. This is now only possible in the UI. Since I'm using the git clone url of the repo, all needed info is provided.

Environment Summary

Windows-10-10.0.18362-SP0
Python 3.6.6
Installer: MSI

azure-cli 2.7.0

Extensions:
azure-devops 0.18.0

jwikman avatar Jun 16 '20 14:06 jwikman