page contents

Why you should be using Team Foundation Server for Dynamics AX lifecycle management?


If you already use Team Foundation Server in your Dynamics AX projects, providing all benefits it can give to your teams, or if you are already convinced to use it soon, then this article is not for you.

You may not be convinced or, even worst, you may disagree about it to be beneficial to your methodologies and team behaviors. You can try to challenge my points with your project’s circumstances that make TFS unacceptable. That’s fine. I’m only asking you to read the full article first 🙂

 

Team Foundation Server (or Visual Studio Team Services*) is a tool, and as such, it will allow you to achieve the same tasks faster and with less effort. Furthermore, TFS will also give the ability to execute crucial tasks that are only available by using this kind of tools. Those tasks are mostly related to development work and source code management, what makes developer’s life easier, but some of them also help project managers and consultants, and support Quality Assurance guidance and validations, testing and all the rest of Application Lifecycle Management steps, whichever methodology is used to manage our projects: Microsoft SureStep, Agile, Scrum, …

Not to mention that using TFS is mandatory in the new Dynamics 365 for Operations, so including it in our lifecycle processes today will ease the transition and will put in place a set of Best Practices than will improve your team since day one.

Let’s have a look at the benefits of TFS in the three main categories of Application Lifecycle Management:

  1. Work
  2. Code
  3. Build & Release

 

1. WORK

WORK module is meant to support project management tasks, but we can get much more from it if we make it part of our team toolbox.

It is a simple, generic, but effective Work Item manager that can be used effectively depending on the methodology used to manage each project. By default, the system creates Work Item Types like Epic, User Story, Task, Test Case, Bug, and so on, but what is more important is that these items are here to support our needs, so use them accordingly.

Work Item Details

It is not mandatory to manage tasks and requirements but it will help you improve Project Management traceability across the team (you can even create those items from Microsoft Project Server). It allows linking code and metadata changes done by one developer, with a comprehensive description that anyone can understand. Thus, at any time everybody will know why a change was done and can provide information about testing and deployment status of every single request received from users, customers or whoever our stakeholders are.

Here are a few examples of critical questions that can only be answered when Work Items are used:

  • Who made this change? Was something else changed at the same time?
  • Why was this object modified? Is this change related to any business requirement, a bug fix, a compliance change request?
  • When was this object modified the last time?
  • How many times has this object been modified? What were the motivations for each change?
  • Which was the application version at the time this change or bug fix was introduced? (Hotfix servicing and upgrades will be a blog post by itself)
  • Which are the differences between the current status of the application and the one when this change was made?
  • Estimate hotfix potential conflicts or code upgrades based on the changes you can see in source control.

Check-In changes to TFS from Dynamics AX 2012

This is a small set of questions you can answer with the most basic use of source control integration with Work Items. The list grows when you start using Branches and a proper build practice as we will see in upcoming blog posts.

Furthermore, you can map your BPM processes from Lifecycle Services with TFS Work Items to synchronize elements between and make easier to the team to access their information using their preferred tool.

 

2. CODE

This is the TFS module used by developers during code and metadata (AOT changes) changes, and where “versions” of the application are stored.

Source Control system provided by TFS makes developer’s life easier and safer and therefore, more profitable for their companies. It is unlikely to see a developer actively refusing to use any source control system. Those advantages are significantly more important when talking about development teams, and amazingly better when talking about distributed teams working in different locations, different countries, different companies (partners) or even different time zones. The more complex the team, the more benefits they will get from any source control mechanism in place.

You may argue that TFS causes extra work to developers. And that is true in theory, but let’s explain how this “extra” work is quickly amortized. Extra steps for developers using a source control system

  1. Check-Out: Before modifying an object, the developer needs to indicate the system that this objects is going to be modified. The system will download the last version from the server, just in case any other developer has modified it, so we can work with the latest version.
  2. Check-In: After changes are done and validated by a developer, a check-in will send those changes to the server so other developers can see our modified version, and will release the previous Check-Out made to this object.
  3. Merge: As many developers may be working with different versions of the same object on their isolated development environments at the same time, making changes to the same piece of code without knowing each other work-in-progress, the final version of the object may need to be manually merged. During merge process, a developer push his version into the server and will needs to take decisions about the final, consolidated version of the object if there are conflicts. Those conflicts can happen if somebody else has made changes to the server version since the current developer downloaded the last version during the Check-Out. All source control systems have tools to make the merging process easy and secure, even automatic if the changes are simple enough.

It doesn’t seem like a lot of extra work. Now let’s analyze what we get in exchange and it will get even better:

  • Check-In/Check-Out mechanism allows several developers to work on the same object without disturbing each other. While modifying an object, a developer needs to save and execute it many times until the final version is ready. It won’t be until the developer checks-in this finished version than the rest of developers will even see those changes. When a developer synchronizes changes from a colleague, it will always get a complete change set, so he won’t be disturbed with unexpected errors due to unfinished changes, something common in shared development environments.
  • Merging changes can be annoying in some cases. But following a good methodology will always be easier than importing XPO files, as the Visual Studio merging tool is way more sophisticated, powerful and quick than the MorphX Compare Tool (it’s fair to say that performance has been really improved in last versions). Anyway, the result of this merging process will always be saved to the server as a new change set. If something goes wrong, one can always see exactly what has been merged, fix it, or rollback to a previous version. Neither of this is available when we are asked to import an XPO file. After we import the file we can’t undo any change or even know what was the previous state.
  • Every Check-In is saved to the server as a change set. This change set links all changes done at the same time to code and metadata to multiple objects, and can be linked to a Work Item or more than one as we mentioned earlier. With minimum effort (like providing a Work Item code during the check-in process, see the previous screenshot), we are creating a fully descriptive change set containing new, modified and deleted objects, and the Task/Bug/Requirement that motivated those changes. This will provide full traceability for every change made and can be even better if we follow some easy rules to merge between Branches allowing, for example, to make code reviews using those Branching change sets.
  • Saving all change sets to the server allows everybody in the project to inspect the change history of any single object in the application, comparing different versions to see what has been the changed over time and, if linked to Work Items, who and why was it changed.

As an example, in the image below we have a full change set as shown by the VSTS portal (it can be accessed from Visual Studio too), showing new and modified objects, the link with 2 work items, and detailed code and metadata changes highlighted in different colors:

Change Set Details

As this view is pure TFS tooling, any member of the team, regardless of knowledge or access to a Dynamics AX instance (of course TFS have its own access and security system), will be able to see and review this change history forever, as this is stored in the source control server regardless of what happens with the Dynamics AX test or development instances. A Dynamics AX 2012 development system based on any version stored in TFS server (including any Branch) can be deployed at any time, as we will see when talking about the BUILD & RELEASE module.

Same example as seen above, but this time from a Dynamics AX 2012 development environment perspective is shown below:

Change History in Dynamics AX 2012

This is an invaluable tool for developers to be able to quickly see the change history of any object and navigate to this version in the AOT, compare with the current or any other version of the object and see what has been changed, or even reverse the current status to a previous version to undo any involuntary or mistaken change. Any developer will love that, there is not much discussion here.

All this code traceability is only possible when TFS is used to track changes. Dynamics AX is such a business-critical application that any code change should be described, controlled and traced. Who, when and why any change is done needs to be clear and easy to access. Customers without such traceability put themselves in dangerous path for regression problems and code instability.

We are still not considering the concept of Branching, closely related with any source control system, which roughly represents different versions of the entire application that we can manage independently. It allows to maintain a detailed version history (What was the status of my application at a specific point of time) that goes in line, but way more in deep of Dev/Test/UAT typical granularity. Branching is an interesting but extensive topic, so we will dedicate a full blog post in the future if our readers are interested on the subject.

 

3. BUILD AND RELEASE

I must admit, build module is my favorite topic: it is where development lifecycle gets closed and the benefits of using a full Application Lifecycle Management (ALM) process can be appreciated in a clear and obvious way by all the team. But it is quite a big topic too, so I will let the details for an upcoming post.

To sum up: In Dynamics AX 2012, we can work with a source control system to develop code and metadata changes, and then export them as a model (I don’t consider XPO files a valid promotion artifact). That works out of the box, but we can go a step further and put in place some automatic tooling to make our deployments quicker, easier and more predictable. The more predictable is a process, the easier to automate it. The more automatic, the stronger and error proof.

Imagine all changes done by our distributed development team are compiled, packed and deployed every night to a consolidated test AOS, so every change finished by our developers the previous day is available to the Testers every morning: That’s the kind of automation we can do with the BUILD AND RELEASE capability.

There is plenty to talk about BUILD AND RELEASE automation and its possibilities, but this post is getting longer than expected. Let’s follow up on the next ones.

 

If you still want to prove me wrong about TFS usage, I will be happy to discuss individual cases with you. I worked myself as a developer and development team lead using TFS, so I am very aware of some limitations regarding physical infrastructure needed for isolated environments, for instance. But, please, always consider that actively avoiding the use of a Version Control System on software projects (and a Dynamics AX implementation is such a project) has a prize that somebody will need to pay for.

Give it a try**. Start simple and evolve as you discover potential improvements to your ALM cycle. Analyze pros and cons, always trying to get the most of the tools, and of course, ask us for advice on the specific case!

 

 

* I use TFS acronym regardless of the version we are talking about, either on premise (called Team Foundation Server) or cloud (called Visual Studio Team Services, or VSTS) as they are pretty much equivalent with minor differences in the meantime the continuous changes deployed to the cloud version are finally released as a new version to the on-premise flavor. Dynamics AX 2012 is compatible with both flavors but some specific versions or hotfixes are needed for some combinations. See Dynamics AX Prerequisites for specific details.

** Testing TFS is never been easier. From an implementation perspective, by using VSTS you don’t need to install nor deploy any component yourself as it works as a service; Cost-wise, VSTS is free up to 5 users, more than enough to test with a pilot team, and overall cost has been greatly reduced even if you need to buy more licenses. Furthermore, license is included in Visual Studio Subscriptions (former MSDN subscriptions) so you may have it licensed already!

 

Comments (9)
  1. Dave Eland says:

    re: “you can map your BPM processes from Lifecycle Services with TFS Work Items” – What I found was a manual process “to export the flowchart to Visio, how to generate a gap analysis, and how to export the gap analysis to a comma-separated file that you can manually import into Microsoft Visual Studio Team Foundation Server as work items.” (see this page: https://ax.help.dynamics.com/en/wiki/flowcharts-in-business-process-modeler/)

    CSV export, import is hardly an integration. Any plans for a true integration between BPM processes and TFS work items like, requirements, code, configuration, test cases?

    1. Hi Dave, Gap Analysis in LCS is being deprecated over VSTS integration. Flows still exists only in LCS, but tasks are in the “Work Ítems” tile in LCS since the last versions. You can test it if you have access to a AX 2012 project in LCS and connect it to VSTS. This Work Ítems tile will show your WI already created in the VSTS project linked to this LCS project.

      EDIT: Just realized “VSO WorkItem Mapping” is a preview feature. Be sure you have it activated in the LCS Preview feature management!

      EDIT 2: More information about VSTS sync. is been published here: https://blogs.msdn.microsoft.com/lcs/2017/02/01/business-process-modeler-bpm-experience-in-lcs/

  2. trud says:

    Can you please also explain in case you have several developers(in AX7) and they deploy their code into test, how code on the dev machines is updated? what triggers this update? for example when I developing in my local dev env. – how often should I update this env. with the latest changes. Right now it suppose a lot of manual work – you need to shelve you uncommitted changes, get the latest code version made by others developers, compile and sync this code, so it can easily take an hour. Is there are any way to simplify this process?

  3. trud says:

    in this “3. BUILD AND RELEASE” it there any setup that allows you to update TEST version more frequently than once a night without interrupting other testers? it can be easily achieved in ax2012 and below by using xpo export-import.

    1. If you want to test the same status you want to deploy to production, testing XPOs is not an option, you need to test models or model store, you will want to compile X++ and CIL anyway, synchronize database, and you will disturb testers already connected to the server. No way you can avoid that, but you can do it quicly if it’s automated. You can create a model from TFS and import into a Test system in minutes. Doing it overnight is only an example, let me explain it in the next upcoming posts.

      If you are testing XPOs, this is a point where new errors will be added during the process (with no tools to analyze them, nor rollback changes). It will be worth to review the whole process and analyze why is that important to use this XPO instead of a better, stronger test with models.

      Long story short: If you need to use XPO to solve a problem, you have two problems 🙂

      1. Kenny Saelen says:

        The sole purposes of using an XPO should be:
        – Moving code between developer machines
        – Moving code from a developer machine to source control and back
        – Combining all of the code in source control and put it on the build machine.

        All other scenarios put the target environment in an unstable state..

      2. trud says:

        one of the example is when you need to run some jobs on production system(you don’t need sycn and CIL in this case) to quickly fix the problem. but I got your idea, thanks

        1. Ok, that can be an exception, but this is more in the hotfixing side than Testing deployment.

          Even this simple case will be impossible in Dynamics 365 for Operations (in public cloud), so it’s nice to addopt a good set of best practices as soon as possible to be prepared.

          Thanks for feedback!

  4. Andre Hopf says:

    Great post. Maybe you want also check the vsts extension for build and release of AX 2012 before you write your next post. 🙂

    https://marketplace.visualstudio.com/items?itemName=SDK4NET.AxBuildToolsV2

    I’am very interested in the branching concepts and how you setup the enviorments to support it.

Comments are closed.

Skip to main content