Setting Up Version Control in Dynamics 365 for Operations With Visual Studio

By Mark Nelson | May 12, 2017

Setting up version control in dynamics 365 for operations with visual studio

The first step to creating a new Dynamics 365 for Operations (Ax7) project is to setup Visual Studio Online (VSO). Visual Studio Online now supports Git version control, but if your solution will be deployed to a customer site, Microsoft recommends that you choose Team Foundation Version Control; at least for any projects that interface with Life Cycle Services (LCS).

If you haven’t already, you need to visit https://www.visualstudio.com to sign up for Visual Studio Online.  You will choose an account name when you sign up. This account becomes part of the URL you will use to access all your projects.

Creating a Project in Visual Studio

Now we will create a project. I will call mine Ax7Experimentation because I plan on using this project to test functionality and try new ideas.

Visual Studio Create a team project

  • Click the Create project button.

Visual Studio Create project name

Now we need to setup the folder structure expected by Dynamics Ax7. Click the Add code button. This will take you to the root folder of your code repository. There you will see a single folder named BuildProcessTemplates. Unfortunately, we cannot create the necessary folders from the web viewer, we must connect Visual Studio to our project and continue from there.

  • Start Visual Studio 2015 as an Administrator. I would recommend checking the box on the Compatibility tab of the shortcut properties.

Visual Studio Properties

Start Page Microsoft Visual Studio

  • If you haven’t done so already, sign into your Microsoft Account (the one you used to create the project).  If prompted, you will need to select Personal account.

Visual Studio Personal account

  • From the Team menu, select Manage Connections… to open the Team Explorer window.

Microsoft Visual Studio Team Explorer Window

  • Click the Connect… link in the middle of the Team Explorer window. From the resulting dialog, select your Team Foundation Server.

VersionControl_MarkNelson7

  • Click Connect.

Now you are prompted to configure your workspace mappings.  This will create a local folder that holds a copy of all your files. It also acts as your staging folder, holding a copy of new files until you submit them.

VersionControl_MarkNelson8

  • Click the Configure your workspaces link.
  • Choose a local folder to store your code.

For Dynamics 365 for Operations (Ax7) work, this folder will only contain your projects and non-Ax7 code. All your Dynamics metadata artifacts will reside in another folder. I will store my code in a new root-level folder called AxTFS.

VersionControl_MarkNelson9

  • Enter your folder name and click the Map & Get button.

You now have a local folder mapped to your VSTO. Click the Source Control Explorer button to open the explorer. Here we will finish the workspace mappings and create the initial required folders. We will start with folders that represent the trunk and main branch; Trunk and Main. Because this folder will hold the files related to Visual Studio projects, we will create a Projects folder. Create the folder structure by right-clicking on each parent node and choosing New Folder.

VersionControl_MarkNelson10

Lastly, we must tell VSTS where to store the Dynamics Ax metadata files. These files are managed by Visual Studio and are in a folder controlled by the AOS service; C:\AOSService.

  • Right-click the Main folder and choose New Folder to create a folder for our metadata. Name the folder Metadata.
  • To change the mapping for this folder, expand the Workspaces drop-down in the toolbar and choose Workspaces…, then click Edit…

VersionControl_MarkNelson11

  • Remap the Metadata folder to the PackagesLocalDirectory folder by adding a new line to the grid.

VersionControl_MarkNelson12

  • Click OK.
  • When prompted, click Yes to get the latest files.  There won’t be any new files however because we just created this repository.
  • Click Close to close the Manage Workspaces dialog.

Now we will submit the folders and add the structure to VSTS.

  • Click the Pending Changes button to see the list of pending changes.  Enter a check-in comment and click the Check In button.

VersionControl_MarkNelson13

The next step is to convert the Main folder into a branch.

  • To do this, right-click the Main folder, choose Branching and Merging > Convert to Branch.

VersionControl_MarkNelson14

  • Enter a comment and press Convert.

VersionControl_MarkNelson15

Notice that the folder icon has changed to a branch icon.

VersionControl_MarkNelson16

When you create a new Dynamics  365 for Operation (Ax7) project, you should store the project in your VSTS controlled Projects folder. The Metadata folder mapping we created will allow Visual Studio to create the project elements in the correct location and still allow you to add them to version control.

VersionControl_MarkNelson17

VersionControl_MarkNelson18

 

Related Posts

Recommended Reading:

Managing Your Business Through Uncertain Times Using Dynamics 365 Finance and Operations

  Dynamics 365 Finance and Operations (F&O) can help you make informed decisions on how to move your business forward. […]

Read the Article
5.13.22 Power Platform

Using Power BI Object Level Security

  The following article will demonstrate how to use Power BI Object Level Security to disable column data based on […]

Read the Article
5.12.22 Dynamics CRM

How to Use the Stoneridge Support Portal

Stoneridge Software’s support portal is an intuitive and useful function that makes it easy for you to access resources to […]

Read the Article
5.6.22 Dynamics GP

Dynamics GP Transaction Removal: Purchase Orders

  Are you having performance issues with Purchase Orders?  Do you find that there are old Purchase Orders on your […]

Read the Article
5.5.22 Dynamics GP

The Real Story about the Long-Term Future of Dynamics GP Support

I’ve seen a number of people put forward comment that Dynamics GP is going away and you have to get […]

Read the Article

New Features in Dynamics 365 Business Central 2022 Wave 1 Release – Financial Enhancements

The Dynamics 365 Businses Central 2022 Wave 1 Release has a lot of new and exciting features to help your […]

Read the Article
4.29.22 Dynamics GP

Dynamics GP Transaction Removals: Bank Reconciliation

  This is part 2 of a 3 part series on Dynamics GP Transaction Removals. These quick tips will hopefully […]

Read the Article
4.28.22 Dynamics GP

Uncommonly Used Features – Integrate Purchasing and Payables to Fixed Assets in Dynamics GP

Being able to integrate Purchasing and Payables to Fixed Assets in Dynamics GP will help you create visibility for your […]

Read the Article

New Features in the Dynamics 365 Business Central 2022 Wave 1 Release – Ease-of-Use Features

  There are many new features in the Dynamics 365 Business Central 2022 Wave 1 Release to get excited about! […]

Read the Article

Start the Conversation

It’s our mission to help clients win. We’d love to talk to you about the right business solutions to help you achieve your goals.

Subscribe To Our Blog

Sign up to get periodic updates on the latest posts.

Thank you for subscribing!

X