Skip to content

Unable to run az pipelines create with the service connection parameter #25232

@alexwhitmore

Description

@alexwhitmore

az feedback auto-generates most of the information requested below, as of CLI version 2.0.62

Related command

az pipelines create `
    --name <name of pipeline> `
    --repository <name of repo> `
    --yml-path <path to file> `
    --folder-path <folder path to place pipeline> `
    --service-connection <connection name>

Describe the bug
When running the az pipelines create command listed above without the service connection parameter, I am presented with:

Which service connection do you want to use to communicate with GitHub?
  [1] Create a new GitHub service connection
  [2] <connection name I want to use>
  [3] <org name>

When I type in 2 and press enter, the command finishes and the pipeline is now created in Azure DevOps.

However, I would like to run this command as part of a script that is non-interactive which means I need to use the --service-connection parameter. When I run the full command listed above in "Related command", I am presented with:
Could not create service hooks subscription. The repository does not reference a service connection.

If the pipeline already exists I am presented with:
Pipeline with name <pipeline name given> already exists.

To Reproduce
With the source code in GitHub, and pipelines in Azure Devops, run az pipelines create with the same parameters used.

Expected behavior
I would expect:

  1. Run the full command (with the service connection name).
  2. Without any interaction, the az cli commands finishes.
  3. The new pipeline is created in Azure DevOps.

Environment summary

  • Windows 10 Enterprise, OS build 19044
  • Installer: MSI
  • Azure CLI: 2.43.0
  • Extensions: azure-devops - 0.25.0
  • Shell type: bash

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions