1
votes

Is there a suggested way to call Projects - Create on a self hosted Azure DevOps Server?

If I use the API on OnPrem self hosted server, I get:

TF400734: This service is only available with hosted Azure DevOps.

but my requirement, to create a new project over API, still exist.


What I try?

When I drag the network traffic on manual project creation I get a bunch of items that I can't handle:

enter image description here

Only the first event projects is a readable post request to:

https://myserverurl.com/MyCollection/_apis/projects

Payload:

id: "b87a57c9-6a50-415a-8da5-869499c02b0a"
status: 0
url: "https://myserverurl.com/MyCollection/_apis/operations/b87a57c9-6a50-415a-8da5-869499c02b0a"

There isn't any event that contains the passed project name and description.

1

1 Answers

2
votes

Currently, the REST API 6.0 version is only supported on Azure DevOps Services (VSTS), not Azure DevOps Server (TFS).

And currently the highest REST API version that can be supported on TFS is 5.0. Generally, the lower TFS version corresponds the lower API version. To view more details, you can see "API and TFS version mapping".

So, for your case, if your TFS version is 2019 or 2020, you can try the REST API 5.0 version. To create a project, you can try this.

POST https://{instance}/{collection}/_apis/projects?api-version=5.0