Search code examples
typescriptazure-devopsazure-pipelinesazure-devops-extensions

How to detect whether AzDO extension is running in YAML pipeline or Classic pipeline?


I've been googling around for this, but can't find anything. Anyone knows a way to detect whether your extension is running in Classic vs YAML pipeline?

I'm working on an extension, which produces ANSI-colored output and apparently Classic pipeline logs UI can't deal with it, whereas YAML pipeline can. Instead of stripping colors completely I'm trying to find a way to be "smart" about it.


Solution

  • How to detect whether AzDO extension is running in YAML pipeline or Classic pipeline?

    I am afraid there is no such a way to limit the custom extension running in YAML pipeline or Classic pipeline at this moment.

    What we can do at the moment is to add a state in the description of the extension:

    {
        "id": "XXXX-A7C8-4A78-A7C3-8D717BB7C13C",
        "name": "YourExtension",
        "friendlyName": "Your Extension",
        "description": "This extension can only be used in YAML pipeline.",
    

    In my opinion this is a reasonable demand, so I suggest that you could add your request for this feature on our UserVoice site (https://developercommunity.visualstudio.com/content/idea/post.html?space=21 ), which is our main forum for product suggestions. Thank you for helping us build a better Azure DevOps.

    enter image description here