Nikhil
Nikhil

Reputation: 3384

Azure DevOps VssConnection - How to tell if the server is hosted or on premises?

Using VssConnection (or something else) is there a way to tell if the server being connected to is on premises or an hosted by Microsoft (i.e. Azure DevOps Service)? My research so far says that if the ServerType GUID is {87966eaa-cb2a-443f-be3c-47bd3b5bf3cb} then it is a on-premises instance but I can't find this documented anywhere.

In the previous version of APIs (SOAP based APIs) the ServerCapabilities enum as returned by an instance of TfsTeamProjectCollection used to be able to do this. The property 'IsHostedServer' on TfsTeamProjectCollection had this information which was actually returned from the server itself.

Is there a way to definitely tell this?

Upvotes: 0

Views: 822

Answers (1)

Cece Dong - MSFT
Cece Dong - MSFT

Reputation: 31083

Update:

I have tested on my side, you are correct that you can use ServerType property of VssConnection to tell whether the server is hosted or on premises. 87966eaa-cb2a-443f-be3c-47bd3b5bf3cb is server, while 00025394-6065-48ca-87d9-7f5672854ef7 is service. Unfortunately, I don't find any documentation states this information. But from the test, the ServerType does give the server information.


Usually, we use the following code to connect to Azure DevOps Service/Server:

VssConnection connection = new VssConnection(new Uri(c_collectionUri), creds);

If you connect to Azure DevOps Service, you would define the c_collectionUri as below:

String c_collectionUri = "https://dev.azure.com/org";

And if you connect to Azure DevOps Server, you would define the c_collectionUri as below:

String c_collectionUri = "http://TFS:8080/tfs/defaultcollection";

Upvotes: 1

Related Questions