Azure DevOps API Create Project TF400734 (OnPrem) - azure-devops

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:
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.

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

Related

Where can I find a full feature comparison of ADO Server 2020 vs ADO Services?

From the point of view of an team admin and user.
Particularly interested in planning tools and boards.
There is no such documentation. However, you can compare some features on this page: Azure DevOps Feature Timeline.
Additionally, Azure DevOps Service continually gets new features. To get new features on Azure DevOps Server, you have to update it.
Example of the last changes on the server on service:

New Service endpoint

I am following along the tutorial with SmartHotel360 and trying to set it up. In the README.md, it says 'In VSTS, navigate to Services by clicking on the gear icon...' and this is to create a new service endpoint. Where is this done? What is VSTS? Visual Studio Team Server? Do I first make a branch of the SmartHotel360 and open this in Visual Studio? What if I am using one email account to access the code where the tasks are assigned and another email to complete the courses? Does this make a difference?
I guess my question is, where is this VSTS? Is this where I view the SmartHotel360 code?
Azure DevOps Services was formerly named Visual Studio Team Services (VSTS) -- rebranded as Azure DevOps in 2018. So the tutorial you followed should be before 2018.
The github README.md about SmartHotel360(like this) are retired, archived, and no longer supported. For the latest sample references please visit: https://aka.ms/tailwindtraders & https://aka.ms/rpsls
To interact with Azure, you'll need to create a Service Endpoint in Azure DevOps. This endpoint includes the authentication information required to deploy to Azure. This document gives a guide to configure Service Endpoint in Azure DevOps, please refer to it.

How can an Azure pipeline get code from intranet TFS 2018

I saw several pages on Internet but none that explains how to do this.
I have Azure Pipelines, a Windows self-hosted agent and an intranet TFS 2018 Server.
I tried to create a “New Azure Repos/Team Foundation Server” service connection with a full access PAT and got this message: “Failed to query service connection API: 'https: //tfs…/defaultcollection/project/_admin/_services/_apis/projects'. Error Message: 'A task was canceled.'” However, I am not even sure this is what I need.
I want a build pipeline to trigger when developers checks-in in VS2019 for a project in TFS. This pipeline would get the code on the agent, build and create an artifact on Azure Artifacts. A release pipeline would take that artifact and deploy on our intranet servers.
Is that possible?
If yes, could you help me find what must be done in Devops and on the TFS servers?
If not, could you please tell me the best way to do the above?
Many thanks
When you create a "New Azure Repos/Team Foundation Server" service connection, you can try to choose Save without verification.
If you want to check in in VS2019 to trigger a build pipeline, then you need to find the Triggers tab in the build pipeline interface, and then enable continuous integration, add Branch filters.
You can install extension TFS artifacts for Release Management in your organization. With this extension, you can deploy artifacts from external TFS. When you add an artifact, select External TFS build, and then add the required information, you can deploy the artifact to your Internal service
You can get the projectId by calling the REST API below:
REST API : https://learn.microsoft.com/en-us/rest/api/azure/devops/core/projects/list?view=vsts-rest-tfs-4.1
Extension TFS artifacts for Release Management: https://marketplace.visualstudio.com/items?itemName=ms-vscs-rm.vss-services-externaltfs

How to identify the latest stable REST API version of Azure DevOps Services?

In my project, there is a requirement to create Azure artifacts feed automatically.
For this I used REST API mentioned in this doc: https://learn.microsoft.com/en-us/rest/api/azure/devops/artifacts/feed%20%20management/create%20feed?view=azure-devops-rest-5.0
and used python to create feed.
POST https://feeds.dev.azure.com/{organization}/_apis/packaging/feeds?api-version=5.0-preview.1
It worked fine.
Later I saw that a new version of API was available.
It is not easy to change the code every time there is a new API version.
So the question is how to identify/use the latest stable working version of API always?
Sorry, there wasn't a hint if there is a new Rest API version released. But just like Matt commented, the old version will not stop working in general. It's quite stable.
Azure DevOps and Team Foundation Server REST APIs are versioned to ensure applications and services continue to work as APIs evolve.
Major API version releases align with Team Foundation Server RTM releases. For example, the 3.0 API set was introduced with Team Foundation Server 2017.
You'll find a quick mapping of REST API versions and their corresponding TFS releases here. All API versions will work on the server version mentioned as well as later versions.
Unlike Azure DevOps Server/TFS, if you are working on Azure DevOps Service, you do not have to pay too much attention which version you are using. It's supported on 1.0~6.0.
Hope it is clearly.

Does Azure Devops Server 2019 include the "Environments" feature

We recently upgraded to Azure Devops Server 2019 but i don't see Environments under the Pipeline menu.
Is the Environment feature present in Azure Devops Server 2019?
I am afraid that the Environment feature is currently not supported in Azure Devops Server 2019. To use the Environment feature, you need to upgrade to Server 2020. For details,please refer to this release note.
In addition, you could add your request for supporting this feature on server 2019 on our UserVoice site , which is our main forum for product suggestions. The product team would provide the updates if they view it. Thank you for helping us build a better Azure DevOps.