【问题标题】:Unable to create Pipeline using azure devops cli in Azure Devops Portal from Azure Repos无法在 Azure Repos 的 Azure Devops 门户中使用 azure devops cli 创建管道
【发布时间】:2023-01-11 20:34:47
【问题描述】:
  • 我安装了 az cli 和 azure-devops 扩展。
>> az --version
azure-cli                         2.44.1

core                              2.44.1
telemetry                          1.0.8

Extensions:
azure-devops                      0.25.0

Dependencies:
msal                              1.20.0
azure-mgmt-resource             21.1.0b1

Python location 'C:\Program Files (x86)\Microsoft SDKs\Azure\CLI2\python.exe'
  • 使用设置组织和项目的默认配置

az devops configure --defaults organization=<org> project=<project>

  • 运行以下命令
> az pipelines create --name 'MyCi'
Error: The following arguments are required: --repository 

但是根据MicrosoftDoc --repository 参数是可选的

  • 我是 DevOps 的新手,对 devops-cliI 了解不多。我尝试了完整的命令。
> az pipelines create --name 'NameCI' --description 'pipeline for project' --repository AzureRepo
--branch main --repository-type tfsgit
Error: Page not found.  Operation returned a 404 status code.
  • 我可以从浏览器成功创建管道
  • 我可以从 azure devops-cli 中删除管道,但无法创建管道。

【问题讨论】:

    标签: azure azure-devops azure-pipelines azure-devops-extensions


    【解决方案1】:

    不能从 Azure DevOps CLI 创建管道。没有命令 az pipelines create 这就是它返回 Page not found 的原因。操作返回 404 状态代码。

    【讨论】:

    【解决方案2】:

    根据doc,我正在尝试为同一项目中 Azure Repo 中托管的存储库创建 Azure Pipeline。

    az pipelines create --name 'ContosoBuild' --description 'Pipeline for contoso project' --repository SampleRepoName --branch master --repository-type tfsgit
    

    我收到了与您相同的错误消息。

    通过指定参数“yml-path”,操作成功。

    样本:

    az pipelines create --name 'CreatedByCLI' --yml-path /azure-pipelines.yml --repository AzureCLIrepo --branch main --repository-type tfsgit
    

    输出:

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-11-23
      • 2021-11-15
      • 2021-01-21
      • 2020-01-19
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多