Dynamics 365 FinOps development using GIT
In this article I will be going over how we can setup a git repository for managing our customizations for D365 FinOps within Azure DevOps.
Create a new model
This step is only required for the purpose of this article. If you already have an existing model you can use that for further steps.
See this article for details on how to create a new model.
For example,
Copy the contents of the model folder created with your AOSSerive/PackagesLocalDirectory folder and store it somewhere. We will use this later to upload the contents of the model to git source control.
Remove the model from the environment so that it longer exists under AOSSerive/PackagesLocalDirectory. This is so that we can clone the source controlled version of the model on this location.
Setting up a GIT repository
Navigate to your Azure DevOps project and click on the repos tab page.
Click on new repository
Download git bash within your development environment
Click on the Clone button from the Azure DevOps repo view and copy the clone URL
Navigate to the the packages local directory path and enter the command git clone [clone URL] [Model name]
This will clone the contents of the repository into the folder named MyNewModel.
Add your model to the repo
Copy the contents of your model, that was mentioned earlier to this folder, for example,
Follow this sample to create one
Add the following to the beginning of the gitignore file for Dynamics365 elements
## Ignore Dynamics 365 files
/Metadata/**/bin
/Metadata/**/Reports
/Metadata/**/Resources
/Metadata/**/WebContent
/Metadata/**/XppMetadata
/Metadata/*/*.xml
/Metadata/*/*.xref
!/Metadata/**/LabelResources
Next enter the command git status within git bash. This will display all items that can be tracked by git source control. Notice that it has identified Descriptor and gitignore files only. This is because the model currently does not have any elements and the files that we do not require to be version controlled we have specified it in our gitignore file.
This will add untracked changes to tracked changes stage them for commit
Enter the following command to commit the changes. This will commit the files to the local repository. But will not be pushed to the server yet.
git commit -m "Added MyNewModel"
Enter the following to push the changes to the server.
git push
Reload your repo within Azure DevOps and notice that the files are now uploaded to source control.
Reload your repo within Azure DevOps and notice that the files are now uploaded to source control.
Check in your modification
Next we will make modifications to the current model. This is just to demonstrate how we can check in our changes whenever we make modifications to a model.
For example, add a new runnable class.
Navigate to git bash and enter the git status command. Notice that new untracked changes have been identified.
Enter the command git status to view the list of elements ready for checkin. Notice the runnable class has been automatically identified for check in.
You can check in all your files using the usual process.
You can use any other form of git source control management tool to achieve the same results as git bash.
Comments
Post a Comment