Skip to content

[BUG]az pipelines list --name fails when name starts with a dot #1476

@dariuszparys

Description

@dariuszparys

Issue: az pipelines list --name fails when name starts with a dot

Summary

The --name parameter in az pipelines list returns an empty array when the pipeline name starts with a dot (e.g., .NET CI Pipeline). Wildcard patterns starting with a dot also fail, but wildcards that don't start with a dot work correctly.

Environment

  • Azure CLI: 2.81.0
  • Azure DevOps extension: 1.0.2
  • OS: macOS (Darwin)
  • Python: 3.13.10

Steps to Reproduce

  1. Have an existing pipeline named ".NET CI Pipeline" in Azure DevOps

  2. List all pipelines (works correctly):

    az pipelines list \
      --organization https://dev.azure.com/<org> \
      --project <project> \
      --output json

    Result: Returns array with pipeline, confirming it exists:

    [
      {
        "id": 611,
        "name": ".NET CI Pipeline",
        ...
      }
    ]
  3. List pipeline by exact name (fails):

    az pipelines list \
      --name ".NET CI Pipeline" \
      --organization https://dev.azure.com/<org> \
      --project <project> \
      --output json

    Result: Returns empty array []

  4. List pipeline with wildcard starting with dot (fails):

    az pipelines list \
      --name ".NET*" \
      --organization https://dev.azure.com/<org> \
      --project <project> \
      --output json

    Result: Returns empty array []

  5. List pipeline with wildcard NOT starting with dot (works):

    az pipelines list \
      --name "*NET*" \
      --organization https://dev.azure.com/<org> \
      --project <project> \
      --output json

    Result: Returns the pipeline correctly:

    [
      {
        "id": 611,
        "name": ".NET CI Pipeline",
        ...
      }
    ]

Expected Behavior

All of these patterns should find the pipeline:

  • --name ".NET CI Pipeline" (exact match)
  • --name ".NET*" (wildcard starting with dot)
  • --name "*NET*" (wildcard not starting with dot)

Actual Behavior

Pattern Expected Actual
.NET CI Pipeline Found Not found
.NET* Found Not found
*NET* Found Found

The --name filter fails when the pattern starts with a dot (.).

Root Cause Hypothesis

The leading dot in the name appears to be causing the filter to fail. This could be due to:

  • The dot being interpreted as a special character (regex or glob)
  • Escaping issues in the filter logic
  • The API treating names starting with . differently

Workaround

List all pipelines without the --name filter and filter locally:

az pipelines list \
  --organization https://dev.azure.com/<org> \
  --project <project> \
  --output json \
  | jq '.[] | select(.name == ".NET CI Pipeline")'

Or use a wildcard that doesn't start with a dot:

az pipelines list \
  --name "*NET*" \
  --organization https://dev.azure.com/<org> \
  --project <project> \
  --output json

Impact

This issue affects tooling that relies on az pipelines list --name to look up pipeline IDs by name. The workaround requires either fetching all pipelines (inefficient for large organizations) or using less precise wildcard patterns.

Related Commands

The --pipeline-name parameter in az pipelines variable list likely has the same issue, as it probably uses similar filtering logic internally.

Metadata

Metadata

Assignees

No one assigned

    Labels

    FeatureFeature Work required.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions