web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :

Source Control for D365 F&SCM through Azure DevOps

Sneha Daggubati Profile Picture Sneha Daggubati

Microsoft Dynamics 365 for Finance and Supply Chain Management uses Azure DevOps as the source control tool. Azure DevOps is not just Source Control for D365 F&SCM, but it offers an integrated set of services and tools to manage your software projects, from planning and development through testing and deployment.

There is a high interest factor on this topic from both our ISV and SI partners, so this post is more generic. In this blog post I will walk you through configuring Microsoft Azure DevOps to enable source control on your models in a development VM.

1.       Configure your Azure DevOps organization and project

2.       Create the recommended folder structure in your team project

3.       Configure Visual Studio to connect to your team project

4.       Map your Azure DevOps project to your local model store and projects folder

5.       Linking LCS to the DevOps project

1. Configure your Azure DevOps Organization and Project

If you already have an account in Azure DevOps, go to the Create Azure DevOps project section (step c) later in this section.

1. Navigate to https://dev.azure.com/ to sign up for Azure DevOps. Click Start Free. Use your organizational account.

2. Create Azure DevOps organization and select a URL for your account. You'll use this URL to connect from your development VM when you're configuring source control in Visual Studio. The following image is an example of the account URL.

 pastedimage1663016833955v1.png

3. When the account is created, you're directed to your account main page where you're prompted to create your first project. Enter Project Name and description and select the version control of your choice.

 pastedimage1663016865141v2.png

 4. To add users to your devops project, click on Organization settings, Navigate to Users section, then click on the Add Users button.

 pastedimage1663016879006v3.png

 5. In the Add New Users dialog, Add the users in your organization that you deem necessary.

pastedimage1663016976851v4.png

2. Create the recommended folder structure in your team project

There is no single best strategy for creating branches. The strategy depends on the project and the size of the implementation.  

It’s a given that the same branching strategy would not work for an ISV and for SI Partner. An ISV can have different needs, it might maintain different code versions to support all their customers and they don’t necessarily need to work in a Main – Release manner. They could have one (or more) branch for each version. 

So, I would recommend referring our well-documented articles on branching strategies and choosing appropriate branch structures for your implementation. Based on my experience here are 2 common approaches:

Main-Release

With this approach, in an implementation project all development will be done on that branch until the Go Live, and just before that a new Release branch will be created. We will keep development work on the Main branch, after UAT, we’ll move it to Release. This branching strategy is simple.

Main-Dev-Release

With this approach, The Dev branch is used for daily work that isn't ready for testing or might not be stable, but that must be shared with other developers. The Main branch is for changes that meet a certain quality bar and are ready for testing by other people. This testing might include user acceptance tests, performance tests, integration tests, and sanity tests after hotfixes. The Release branch holds all source code exactly as it's deployed in a production environment at any given point.

Create folder structure in your devops project:
If you do not see Repos Section in your devops project, go to Project settings and turn on the Repos.

pastedimage1663017148152v5.png

In your Devops Project, Go to Repos and create folder structure by clicking on the New Folder button as shown in screenshot below:

pastedimage1663017188383v6.png

In this walkthrough I will adopt the Main – Dev branching structure to demonstrate the devops setup. All development will be done in Dev branch and will be merged to Main for Testing from where it will be released. We will create Dev branch in Visual studio in next steps.

3. Configure Visual Studio to connect to your team project

1.       Start Visual Studio. If you are logged into the machine as an administrator, then you must start Visual Studio as an administrator.

2.       Click Tools > Options > Source Control > Plug-in Selection.

3.       In the Current source control plug-in field, select Visual Studio Team Foundation Server.

4.       Select Team > Manage Connections

5.       In Team Explorer, click Select Team Projects.

6.       In the Select a Team Foundation Server drop-down list, select the Azure DevOps organization that hosts your devops project, or click Add TFS Server if it isn't in the menu.

a.       When the Add/Remove Team Foundation Server dialog opens, click Add.

b.       Enter the URL of your Azure DevOps organization.

c.       Click OK.

d.       If prompted, enter your Microsoft Account username and password.

7.       Select your devops project check box under Team projects, and then click Connect.

pastedimage1663017350914v7.png

8. Create a local folder structure to hold your projects folders. Trunk-> Main-> Projects and Trunk -> Dev-> Projects

pastedimage1663017406462v8.png

4. Map your Azure DevOps project to your local model store and projects folder

1. Once you are connected to your devops team project, you see the Team Explorer appear as below, Open Source Control Explorer from Team Explorer

pastedimage1663017533185v9.png

2. Map the Main Folder to the local Main created above. 

pastedimage1663017569836v10.png

3. Convert Main folder to Branch, later you can create Dev branch from Main for Development and map to dev VM.

pastedimage1663017657431v11.png

4. Map the Metadata folder in Main Branch of your team project to the root folder of the model store on your local drive (Typically K:\AOSService\PackagesLocalDirectory), an example is shown in the image below.

pastedimage1663017708363v12.png

5. Click Map, and on the next dialog, click No.

6. Similarly, map the /Trunk/Dev/Projects devops server folder to the local projects folder that will hold your Visual Studio solution and project files.

5. Linking LCS to the DevOps project

If you have not linked your devops project during environment deployment you can still do it at this stage.

1. Go to the Devops page

2. In the upper-right corner, click .pastedimage1663017849857v13.png

3. Click on the Personal access tokens tab, click Add.

4. Enter a description, such as LCS Support system account.

5. Select an expiration date of one year.

6. Click Selected scopes, and then select Work items (read and write).

7. Click Create token.

8. Copy the token and paste it in a safe location because it won't be accessible after you move away from the page.

9. Sign in to LCS by using an account that has the Owner role for the LCS project that the application is deployed in.

10. Open the project in LCS.

11. Click the Azure DevOps link. Click Setup Azure DevOps.

12. In the Azure DevOps site URL field, enter the URL of the Azure DevOps project that you created in the previous section.

LCS requires entering the Azure DevOps root URL in the legacy format. The legacy format is https://ACCOUNT.visualstudio.com and https://contoso.visualstudio.com.

pastedimage1663017877118v14.png

13. Click Continue.

14. Select the VSO project to use, and then click Continue.

15. Click Save.

16. Click Authorize.

17. In the confirmation message box, click OK.

18. Sign in to Devops.

19. Click Accept.

Congratulations!!!!  You have successfully configured your development environment for source control and follow by next blogs for CI/CD setup for D365 F&SCM. You can go ahead and create your Model and create amazing extensions for D365 F&O.

Comments

*This post is locked for comments

  • Community member Profile Picture Community member 10
    Posted at
    Source Control for D365 F&SCM through Azure DevOps
    Well detailed. Thanks Sneha for sharing this useful piece.
  • Hisham Alsayed Profile Picture Hisham Alsayed 750
    Posted at
    Thanks for sharing and valuable article. Would you share the same steps using GitHub as source control.