Search code examples
azure-devopsazure-devops-extensionstfx

TFX-CLI fails on "tfx extension create"


Background: Using AzureDevops Services as Ci/CD, there is a need to create a custom Service Endpoint, following these documentations.
Followed after that by this publish, which is failing.

Target: Create custom Service Endpoint.

Issue: while running the "tfx extension create" command, i'm getting this error (no debugging seems to be working):

C:\Users\USER\Desktop\extension>tfx extension create --trace-level debug
(node:19816) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
TFS Cross Platform Command Line Interface v0.8.3
Copyright Microsoft Corporation
2020-10-29T15:52:51.089Z : cache.getItem
2020-10-29T15:52:51.098Z : merger.merge
2020-10-29T15:52:51.099Z : merger.gatherManifests
2020-10-29T15:52:51.106Z : Merging 1 manifest from the following paths:
2020-10-29T15:52:51.107Z : vss-extension.json
2020-10-29T15:52:51.112Z : Path 'C:\Users\USER\Desktop\extension\node_modules\vss-web-extension-sdk\lib` is a directory. Adding all contained files (recursive).
2020-10-29T15:52:51.115Z : -- VSS.SDK.js
2020-10-29T15:52:51.117Z : -- VSS.SDK.min.js
2020-10-29T15:52:51.120Z : Path 'C:\Users\USER\Desktop\extension\BuildTaskFolder` is a directory. Adding all contained files (recursive).
2020-10-29T15:52:51.121Z : -- task.json
2020-10-29T15:52:51.130Z : Generating [Content_Types].xml
2020-10-29T15:52:51.137Z : Error: There were errors with your extension. Address the following and re-run the tool.
2020-10-29T15:52:51.137Z : One or more 'categories' must be provided.
2020-10-29T15:52:51.137Z :     at C:\Users\USER\AppData\Roaming\npm\node_modules\tfx-cli\_build\exec\extension\_lib\merger.js:212:39
error: Error: There were errors with your extension. Address the following and re-run the tool.
error: One or more 'categories' must be provided.

An advice would be mostly appreciated.


Solution

  • According to your error message: error: One or more 'categories' must be provided. You need to add categories to your vss-extension.json file. This file contains required attributes. Categories is an Array of strings representing the categories your extension belongs to. At least one category must be provided and there's no limit to how many categories you may include. For example:

    "categories": [
            "Azure Boards"
    ],
    

    You can find more information about required attributes in the document.