Search code examples
azure-devopsyamlado

Execute YAML from Classic pipleine with parameters


This question may sound duplicate, I looked other questions and answer but didn't find solution. If you feel there is please direct me to that question. Alright, My organization is already using Classic Pipelines and they are not yet ready to completely use YAML release, for some reason. We have YAML template, is there a way I can execute YAML with parameters from Classic pipeline?


Solution

  • You may consider using rest API. If you have a separate yaml build, you may add rest calls to the classic pipeline:

    1. Get the current build run (using Build.BuildId): Builds - Get
    2. Check the parameters in the response: Build
    3. Queue your yaml build with parameters from step 2: Builds - Queue, Powershell example.

    and enable the system access token on the classic pipeline to use it in your scripts: System.AccessToken