This blog describes the process of setting up Git as version control for the Dynamics 365 Finance and Operations project.
Before starting to set up make sure you have Visual Studio 2017 or above and the latest Git installed on your system.
Initial Steps:
- Create a new project in DevOps and select version control as Git.
2. Then go to repos and create a new repository if a default repository is not created upon creating a new project.
3. Enter repo name and select type as Git. Select the add README option and select visual studio in the “Add a .gitignore” type selection.
Clone Repo & Setup Folder Structure:
- Access your D365 Finance and operations development environment and open Visual Studio as an administrator
- Open Team Explorer and select the plug icon then select Manage connections and then select Connect to a project
3. Select the project and select connect. It might ask for credentials upon connecting, provide the credentials which you are using for DevOps sign In.
4. Clone the repository. You can change the clone directory. It is preferable that you create a root folder in C: drive and clone your project there.
5. Following will be the structure of the folder after cloning completes.
6. Add these three folders to the cloned repo directory.
7. Create a power shell script using the provided script with the name “Mount” in the scripts folder.
8. Go to team explorer in Visual Studio and select Changes.
9. Commit the initial changes.
10. Push these changes to the DevOps repository.
11. After the above steps create a new custom model with the project in D365 Visual Studio.
12. Stop the AOS service in IIS Manager. Then in the PackageLocalDirectory cut the newly created model folder.
13. Paste it into the Metadata folder created in the above steps.
14. Delete any app folder and bin or Xref files if exists in your model’s folder.
15. After these steps open a PowerShell command prompt as admin. Run the Mount.ps1 file created in the above steps. The project will be linked to source control and any changes can be pushed to the repo.
For Existing Model:
If a Project/model is deployed through a deployable package or imported through a axpp file it can be added into source control through the same process just skipping the new model creation step.