Saturday, 15 July 2017

Sizing Backlog Items with Team Services

Backlog item sizing will help an Agile team to identify their velocity and plan for future iterations/sprints considering it. It is important the team members have discussed a backlog item and have a common understanding on what needs to be done before it is relatively estimated. Sizing for backlog items in Team Services work items such as User Story, Bug can be updated in Story Points or Effort field depending on the template you are using. Team Services extension, “Estimate” is available in Visual Studio Marketplace allow you to do effective estimating of backlog item, by enabling team to vote for each work item using on Team Services, while getting Story Points or Effort field update automatically with the size value, once team is committed to a size.

Saturday, 8 July 2017

Ignoring Visual Studio 2017 Created Files in Git

Visual Studio 2017 creates few files such as slnx.sqlite, .suo and these files often give trouble if you get it added to a branch in Git version control. Every time you open a solution in Visual Studio 2017, these files are indicated as pending changes and you are unable to do a pull, push etc. without undoing or committing these files. This is annoying since you actually do not want these to be added as changes to version control repository. You can try completely removing the files not needed from repository but if you are not willing to go through somewhat risky procedure, what options you have for solving this problem?

Friday, 30 June 2017

Team Services - Custom In Progress Sate to Completed State – Closed Date Not Updating Issue

Team Services now allows work item states to be customized and you can change the workflow to your preference. This is explained in the previous post “Custom States for Work Items in Team Services with New Process Customization Experience” in detail. As explained there you can hide available default states and use your custom sates instead of them. But as of now state change from a custom state to Completed category state does not update the Closed Date and Closed By fields in Bug and User Story/PBI work items. For Task work item in custom state , changing to Completed category state, updates Closed Date but not the Closed By field.

Let’s further understand this issue with an example.

Thursday, 29 June 2017

Custom States for Work Items in Team Services with New Process Customization Experience

Custom states for work items could be introduced and usage of new custom workflow for state transitions, is possible in team services from some time back. The post here describes how to customize work item states. With latest updates to Team Services a new process customization experience is introduced as described in “Team Services Process Customization”. Let’s  explore the state workflow customization of work items with the new process customization experience.

Thursday, 22 June 2017

Team Services Process Customization

Team Services is coming up with many improvements and one of it is the new process customization experience introduced recently. This allows you to have your own custom work item types, custom work item state flows and custom fields for work items etc. It is made easier to start customizing even directly from work item form. Let’s look at and understand process customization options available for you to optimize your work process.

Friday, 16 June 2017

Deploying Web Apps to Azure Virtual Directories

My friend Jaliya Udagedara has written nice post here, explaining how to deploy a Core web application into Azure App Service Application virtual directory. Below is comparison of few more settings you can use with Azure virtual directories.

Saturday, 3 June 2017

Deployment Groups in VS Team Services

Deployment groups provide robust out-of-the-box multi-machine deployment with team services release management. It allows you to run deployments across multiple machines. You can install agent on each of your target servers directly and run rolling deployment to those servers, unlike agent based deployments where you install build/deployment agents on proxy servers in an agent pool. You can use all tasks in task catalog on your target machines.

Deployment group allows you to create target deployment machine groups, without requiring you to register machines in agent pools or queues. Machine in a deployment group will have an agent registered with the named deployment group, within the team project providing required isolation for target environment (such as DevInt, QA, UAT, Demo, Production etc.), for a given product or project.

Logical group of targets (machines) having an agent installed on each of them is a deployment group. It represents your physical environments. It can be single-box, multi-machine or a farm of machines. You can specify the security context for your physical environments by using the deployment groups.

Let’s look at how to create a Deployment Group in Team Services.

Thursday, 18 May 2017

string.Format & { }

C# developers often use string.Format in handling string. string.Format the { and } is used as a special character to identify the parameters.

For example:

scrollDepth = “10”

string.Format("DOWN {0}",scrollDepth)  generates a string DOWN 10.

But what if a { should be used as a value in the string. Is there a way to include { in the string?

To escape a { you can {{. So if you want to get the resultant string as “{DOWN 10}” the syntax to use is

string.Format("{{DOWN {0}}}",scrollDepth)

Thursday, 11 May 2017

Auto Generating CD Build/Release Pipeline Targeting Azure App Service for MVC Web Application

VSTS allows great flexibility with it’s new web based build and release management features. You have several templates which can be used to create build and release definitions you need quickly. Lots of out of the box tasks allow you to further customize your definitions to support the steps that you need to perform during a build or a deployment. Visual Studio Marketplace is getting more and more components added to it, allowing you to find a task for almost any build deploy step you may require to perform. Taking the steps to the next level, you can now even generate your build/release pipeline with Visual Studio 2017, after adding the extension Continuous Delivery Tools for Visual Studio.

Let’s walkthrough the steps of generating a CD pipeline for an MVC Web Application, to allow it to be deployed to Azure App Service.

Wednesday, 3 May 2017

Enable Conditional Build/Release Tasks in VSTS

TFS/VSTS new build and release management is providing great flexibility in implementing CI,CD pipelines. To further enhance the flexibility a new feature “Conditional Tasks” is introduced to Tasks of build and release management. This was a user voice request that got implemented and available as preview in Team Services. This new conditional control option let’s you execute a task base on few predefined conditions and using custom conditions.

Predefined conditions

  • Only when all previous tasks have succeeded
  • Even if a previous task has failed, unless the build was canceled
  • Even if a previous task has failed, even if the build was canceled
  • Only when a previous task has failed

 

Monday, 17 April 2017

Building ASP.NET Core 1.1 Web App with Team Services

ASP.NET Core 1.1 is available with Visual Studio 2017 and it is based on .csproj to provide us with a consistent experience inside Visual Studio. .csproj will be the way forward with ASP.NET Core and Microsoft encourages everyone developing on ASP.NET Core to move to Visual Studio 2017. You can see the recommendation in https://blogs.msdn.microsoft.com/dotnet/2017/03/07/announcing-net-core-tools-1-0/ quoted below. Microsoft will not be updating VS 2015 based tools for .NET core anymore.

Friday, 7 April 2017

Setup yo team

yo team is a great NPM package by Donovan Brown, to automate creation of build and release pipelines. You can use it to generate app with CI/CD in Team Foundation Server 2017 or Visual Studio Team Services. In this post let’s look at how to get it installed, for you to use it to generate CI/CD pipelines

The first requirement is to install node.js and npm latest. You can download it from https://nodejs.org/en/download/. Instruction on installing on windows is here. You can verify the installed version of node and npm by running below commands.

Wednesday, 29 March 2017

Resolve - TFS Build Hang When Building Wix Projects

Wix tools can be used to generate msi installable packages, .exe setup bundles, .msm merge modules, and .msp patches. Getting a wix project built with visual studio is fairly simple. If you are using VS you can install the extension from marketplace and install wix tools to get going in the development environment. Tools available for VS 217, 2015, 2013, 2012 and 2010.

You can setup TFS builds to build wix projects following the instructions in http://wixtoolset.org/documentation/manual/v3/msbuild/wix_with_team_build.html. There is more detailed documentation available in http://wixtoolset.org/documentation/manual/v3/msbuild/. The blog here also useful http://programcsharp.com/blog/post/building-wix-with-msbuild.

However, when you are running a build to package .msi etc using wix project you might notice the build sometimes hangs forever. This happens because of a deadlock when msbuild and wix waiting on the output stream.

Monday, 20 March 2017

Sonar Server on Azure VM

SonraQube has become grate tool providing detail analysis of code quality. Tracing of history of code quality checks let the development teams identify how the code quality improved (could be how the code is gotten so bad even). How to setup a SonarQube server to use with team foundation server is described in the post “Setting Up Sonar Server for TFS”. Let’s look at steps required to set this up in an Azure virtual machine and expose it to use with team services account.

  1. Setup an Azure virtual machine with Windows Server 2012 R2 Datacenter.
  2. Follow the instructions in the post  “Setting Up Sonar Server for TFS” and get the SonarQube server running inside the virtual machine.
  3. To allow accessing the Sonar server default port 9000 through firewall of the virtual machine add an inbound firewall rule in the virtual machine allowing port 9000 for public and private access.
  4. Above step alone will not allow public access to Azure VM hosted sonar server. You need to allow accessibility in Azure nsg(network security group) for the port. To do this go to the virtual machine in Azure portal, select Network Interfaces and click on the network interface.

Wednesday, 22 February 2017

Resolve MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.0-rc4-004771\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found or Unable to start the process. No executable found matching command "dotnet-projectmodel-server"

You might encounter compilation error in Visual Studio 2015 when a new .NET Core 1 web app is created, if you have installed Visual Studio 2017 (RC as of now). When a new .NET Core 1 web application is created/opened in Visual Studio 2015, with the project template you get with .NET Core 1.0.1 tools Preview 2, while having ".NET Core cross-platform development" for Visual Studio 2017 in your machine, you might see below error prompted.
---------------------------
Microsoft Visual Studio
---------------------------
The following error occurred attempting to run the project model server process (1.0.0-rc4-004771).

Unable to start the process. No executable found matching command "dotnet-projectmodel-server"
The project model server process provides intellisense, build, and reference information to Visual Studio and without it your experience will be very limited. Please try closing and reopening Visual Studio to see if that corrects the problem. Alternatively, check that the .NET Core SDK is properly installed.
---------------------------
OK  
---------------------------

When attempt to compile the solution you may encounter a compilation error below.
WebApp.xproj(7,3): error MSB4019: The imported project "C:\Program Files\dotnet\sdk\1.0.0-rc4-004771\Microsoft\VisualStudio\v14.0\DotNet\Microsoft.DotNet.Props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.

Monday, 20 February 2017

SonarQube Extension for VSTS/TFS

In the post Setup SonarQube Analysis with TFS Builds usage of Sonar Server with TFS build to measure quality of code is explained. The task catalogue tasks explained in the post Setup SonarQube Analysis with TFS Builds are now deprecated. There is an extension available in marketplace for SonarQube. This extension provide new begin analysis and end analysis tasks to be used in a TFS build.
Once you install the SonarQube extension for VSTS/TFS you can setup service endpoint type of SonarQube.

Wednesday, 1 February 2017

Bulk Editing Work Items in TFS

There was a question from a team member how to bulk edit TFS work items. In the past the only answer to this question would be use excel. Open a query in Excel and update and publish. Is there any other way to achieve this easily without doing one by one work item edit in a query result? Query result opened in Web or in Visual Studio you can edit each work item by clicking on each, and then save bulk of work items. But is it possible to change a value of a field for many work items at once. Let’s look at the bulk edit options available with TFS see the possibilities.

Monday, 30 January 2017

Trigger a Release Based on Build Tag– VS Team Services

Visual Studio Team Services now supports triggering a release, in team services release management, when a defined tag is available in a completed build. This helps you to filter a build or builds, to get deployed via the release pipeline, out of builds that are successfully completed.
For example a build that is tagged as RTM, would trigger a release while another build, completed successfully, but with no tag is not triggering a deployment. In order to say a release should only be triggered with a given tag, it should be defined in the Triggers tab of the release definition.

Sunday, 1 January 2017

Resolving “Deployment on this environment was cancelled.”

You might encounter “Deployment on this environment was cancelled.” when you have setup a new build/release agent and try to do a deployment, with on premise TFS. It is a confusing error message and not enough information at all to identify the issue. How to identify where the problem is easier if the agent is on premise. Then you have the ability to look at additional diagnostic logs. Lets look at one example scenario you are getting this error.