Posts

Prevent specific users from modifying area and iteration in a Work Item Type

It is not supported to add READONLY or FROZEN rules on the System.IterationPath and System.AreaPath. A work around is to create a custom field named "You cannot change this field" for example. Give it the Integer type. In the "Rules" tap, add one WHENCHANGED rule for each field you want to protect. In the first one, select System.AreaId in the Field Condition, and navigate to the Rules tab. Add two rules: COPY For: the TFS group containing the users not authorized for change From: value Value: leave empty REQUIRED For: the TFS group containing the users not authorized for change Do the same for the second WHENCHANGED rule for System.IterationId Basically, the following sequence will trigger when an unauthorized user tries to change a protect field (System.AreaId and System.IterationId linked respectively to System.AreaPath and System.IterationPath) : The field value is changed to blank The field is set to REQUIRED This triggers a validation...

VNet to VNet connection in Azure from different subscriptions

In case you need to connect subnets in different Azure subscription, you might come across the following (nice) article: https://azure.microsoft.com/en-us/documentation/articles/vpn-gateway-vnet-vnet-rm-ps/ I just wanted to give a little more information based on my experience with the actions involved. If you try to follow the steps to connect the subnets using pre-existing gateways, it will not work. You have to create the gateways using the provided instructions. I suppose it is due to the fact that gateways created from the Portal have the "Basic" SKU (you can see it using the Resource Explorer). The PowerShell instructions include a specific parameter named SKU and we have to pass the "Standard" value. At the time of the writing it is not possible to pass this parameter in the Portal, hence the need to use PowerShell to create the gateways.

Find all TFS work items for which the original estimate has been changed

You might find yourself having to track down bad practices (like modifying the original estimate of a task). You could setup an alert to be notified as soon as it happens or you can monitor changes through the TFS database. Today, I'll explain how to monitor using a query on the TFS database. We will use the collection database. The idea is to use the views related to work items and their history. The first step is to union the data sets (the current work item states and the past work item states). Then we select the record having an original estimate higher than the previous version. THAT is the tricky part. I used the LAG analytic function to get the reference to the "previous" record (that is, the same id but the previous revision). Here is the complete statement. WITH AllData AS (   SELECT *     FROM [Tfs_DefaultCollection].[dbo].[WorkItemsAreUsed]    UNION *     FROM [Tfs_DefaultCollection].[dbo].[WorkItemsWereUsed] ), AllDat...

Microsoft Visio and Azure

If you find yourself having to create diagrams for Cloud architectures in Visio, there are nice stencils from Microsoft with all the Azure services ! Here is the download link

Migrate TFS "Repro Steps" field to the description

I recently decided, for a specific team project, to use the Description field instead of the Repro Steps field in the Bug work item. The main reason is to be able to create reports for both Product Backlog Items and Bugs, while being able to display the full description. The first step was to migrate the content of the Repro Steps field into the Description field in order to retain data for existing items. Since it is not possible to do field-to-field bulk update from the Web interface, I had to create a small console application to copy the data. The main problem I encountered was about inline images. When you copy and paste a screenshot into an HTML field, it creates an img tag with Base64 data in the src attribute. For an unknown reason, when the data in the src exceeds a certain limit (I don't know the actual value), the src attribute is blanked during the save. Images simply appear blank in the target field. After some search, I came across this post from René van Osnab...

Useful fields in the TFS Database

If you ever need to retrieve the parameters (and respective values) of a test case (for reporting purposes for example), the database table to read is Tfs_<CollectionName>.dbo.WorkItemLongTexts . It contains the HTML/XML field values for each workitem. The only missing part is the ID of the actual field you want to retrieve : FldId 10018 contains the definition of the parameters FldId 10029 contains the values of the parameters

Deploy an ASP.NET MVC Web Application to Azure Website using Release Management for TFS

Image
There are a lot of articles about the integration of an Azure VM into Release Management for TFS. What if you simply want to deploy an ASP.NET MVC application without the need to provision a dedicated machine. It turns out to be quite simple. One of the most efficient way to do it is to create the initial deployment from Visual Studio and then pick up the piece to build a RM template. My Web Application is quite simple: a database, a Entity Framework Code First model all sitting inside the ASP.NET MVC application. Like all deployments, the main process is: - generate the Web Deploy Package with placeholders for configuration (connection string, parameters, etc.) using TFS Build (or whatever build system you have). - Deploy to the staging machine (using a agent-based or agent-less machine) - Run the MS Deploy CMD file with the appropriate parameters to trigger the deployment on Azure. The reason I use a staging machine as the basis for the CMD is that it allows me to restrict th...