Skip to content

Azure Pipelines variables set in yaml cannot be overridden from the UI #6904

@lbussell

Description

@lbussell

Disable publishEolAnnotations in core-official.yml to unblock publishing (dotnet/dotnet-docker#6895) was required in order to set publishEolAnnotations to false in the dotnet-docker-nightly build. This is because 1e926ae added publishEolAnnotations to the pipeline yaml so that it did not need to be manually added to all the pipelines via the GUI, since that is manual work that is prone to human error. The goal was to define all of the variables in one place for similar pipelines.

Unfortunately, those can't be overridden by setting variables in the pipeline UI. From the Azure pipelines documentation:

When you define the same variable in multiple places with the same name, the most locally scoped variable wins. So, a variable defined at the job level can override a variable set at the stage level. A variable defined at the stage level will override a variable set at the pipeline root level. A variable set in the pipeline root level will override a variable set in the Pipeline settings UI. You can use variables with expressions to conditionally assign values and further customize pipelines.

Since the variable set in the yaml pipeline is more local than the variable set in the pipeline UI, the yaml pipeline variable wins. The solution to make certain settings overridable again is to transition them back to azure pipelines UI variables. This applies to:

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions