Configuring TFS Proxy

Now that you know what a proxy for Team Foundation Server is used for and how you can use it, it would be interesting to know how to install and configure it. Well good news, it is precisely the objective of this article! Let me tell you right away; The installation of the proxy is not much more difficult than that of the main product, and I do not even talk about its configuration.
As with the configuration of Team Foundation Server, you first arrive on a screen indicating why a proxy is useful or unnecessary (Figure 1). Click the Start Wizard button to start.


Figure 1

The next screen is not much more interesting. This is simply the Welcome screen of the Setup Wizard (Figure 2). Click the Next button to move forward.


Figure 2

This is where the configuration actually begins.You now have to select the team project collection that the proxy will serve. Use the Browse button to connect to the application and select the collection (Figure 3).


Figure 3

Like most Team Foundation Server features, the proxy uses a service (or a user account that connects as a service) to authenticate itself. You must specify an account and the type of authentication you want to use (Figure 4).


Figure 4

On the next screen, you must specify a port number to access the proxy and the directory you want to use for the cache (Figure 5).


Figure 5

The basic configuration is already complete. You get a summary of the options you have chosen (Figure 6). Click the Next button to confirm.



Figure 6

As usual, your system checks are launched. When all checks are completed (Figure 7), click the Configure button to complete the process.



Figure 7

If all went well, you arrive at a success screen with some additional information about exceptions added to the firewall, configuration file, logs, … (Figure 8). Click the Next button to reach the review screen where you can close the configuration wizard (Figure 9).



Figure 8


Figure 9

Note that the administration console does not allow you to add many collections to the proxy but you can use the following command to do so:

TfsConfig proxy /add /collection:http://keep-tfs:8080/tfs/SomeOtherCollection

If you want to modify the cache limit, you have to manually edit the configuration file (Figure 10).


Figure 10

Connecting Visual Studio to a TFS proxy

When your proxy server is configured on a tier application, you still need to configure Visual Studio on the client side to connect to it. But do not worry, this is a step of a few seconds. Simply go to the Tools/Options menu in the editor, open the Source Control section, and select Visual Studio Team Foundation Server. This gives you access to TFS options including proxy options (Figure 1).


Figure 1

Check the box specifying the use of the proxy and specify the address of your server and the port used (8081 by default). You can also enable SSL mode via the second proxy box. Easy isn’t it ?

Introduction to TFS proxies

At the source control part of Team Foundation Server can be appended a proxy installed on a separate server. The purpose of this option is to place the downloaded objects in a cache and thus allow access to the sources directly via this proxy rather than the main server, reducing the bandwidth to the latter. The most common scenarios are remote work and server overhead. Let us see these two possibilities together.

Remote team working

Let’s take a first example in which our TFS server is used by several development teams, some of which work remotely. Note here that by distance, I mean outside the LAN. Basically, some equipments are on the same network as the server and others connect from the outside. In such situations, remote teams may encounter latency issues when retrieving files from the server (Figure 1).


Figure 1

This is where our proxy comes in. By adding a server on the external network, you can install a TFS proxy that will pick up the files on the main server and place them in its cache. On-site teams will be able to connect to the proxy server over LAN rather than directly connect to the TFS server in WAN, thus benefiting from a faster connection when retrieving files (Figure 2).


Figure 2

Of course, the first time a file is requested, the proxy must first go to the main server and the access time will be longer. But during the next accesses, it will be directly recovered from the cache and the access time will therefore be much faster.

Server overload

Let us now discuss another case that may require the use of a proxy. When the main server is too busy, performance may be affected and recovery of files on the source control takes a long time. These solicitations can come from different sources: project team members (project managers, analysts, architects, developers, testers, …), work items actions, build servers, test servers, etc. Overload may come faster than you think. It is therefore sometimes useful to place one or more proxies on the LAN, so that the performance is distributed equally when retrieving files. To take a concrete example, it happens to have to launch a build in the middle of the day, while all the team members work. If you configure the build server to retrieve sources through the proxy and not directly through the TFS server, you can use the cache largely and thus relieve the main server and make it more available to the teams. Even if this second case is possible and would solve your performance issues, I would rather recommend to scale the main server up if possible, as it is always better to directly work on the main application tier than using a cache.

I hope you have clarified the usefulness of a proxy within Team Foundation Server. All you have to do is identify potential needs in your projects and, if necessary, install one or more proxies in your infrastructure.

Work Item rules

When you modify a work item type, you have the option of applying rules to each of the fields present. Although the name of most rules is enough, it remains mysterious enough for others. Here is a short description of each of the available rules:

  • ALLOWEDVALUES: Specifies a list of possible values for the field.
  • ALLOWEXISTINGVALUE: indicates that the current value is allowed.
  • CANNOTLOSEVALUE: Once the field receives a value, it can no longer be emptied.
  • COPY: copies a value to another field or a system value.
  • DEFAULT: indicates a default value to be placed in the field.
  • EMPTY: the field is emptied and grayed out.
  • FROZEN: makes the field non-modifiable as soon as it is given a non-zero value.
  • MATCH: indicates a format that the value must respect. This rule applies only to string fields. The letters A, N, X are interpreted respectively for alphabetic, numeric and alphanumeric characters. All other characters are treated as simple literals.
  • NOTSAMEAS: indicates that the value must be different from that of another field.
  • PROHIBITEDVALUES: Specifies a list of forbidden values for the field.
  • READONLY: the field is not modifiable and is grayed out.
  • REQUIRED: the field is mandatory.
  • SERVERDEFAULT: fills the field with the value given by the server at the time of the backup. The field appears as read-only.
  • SUGGESTEDVALUES: specifies a list of recommended values but does not prohibit the encoding of other values.
  • VALIDUSER: The value must match a valid user.
  • WHEN: Specifies a list of rules to apply when a field has the specified value
  • WHENNOT: Specifies a list of rules to apply when a field has a different value than the specified value.
  • WHENCHANGED: Specifies a list of rules to apply when a field changes its value.
  • WHENNOTCHANGED: Specifies a list of rules to apply when a field does not change its value.

Resetting Team Foundation Server configuration

As already discussed in other articles, configuring Team Foundation Server via the administrative console is very simple. But it may happen that we make a mistake and we want to start from scratch. Unfortunately, once the configuration is complete with the wizard, the Home screen turns into a summary screen. It is of course possible on this screen to modify the options one by one but it is sometimes insufficient. A complete reset is then necessary. However, this operation is not available in the Administration Console. It will have to be done by command line. Anything related to the configuration of TFS and its components is linked to the TFSConfig command. Deconfiguration is no exception. To this must be added the options as well as the components to be reset. In the end, we get the following command:
TFSConfig setup / uninstall: all
This command resets all components but can be done individually by replacing the all by the names of components separated by ;