Monday, November 18, 2024
Folder Structure for Dynamics 365 FO: Practical Guidelines for Organized Development
Posted by
Maintaining a consistent folder structure is a fundamental aspect of managing Dynamics 365 for Finance and Operations (FO) projects. A well-thought-out structure makes code easier to find, reduces maintenance overhead, and supports effective collaboration in teams. This post explores a recommended folder structure, its components, and some practical considerations for getting started.
A Recommended Folder Structure
To keep things manageable and logical, the following structure is suggested:
/App
/SourceCode
/BinaryOnly
/CustomScript
/License
/Pipeline
/Solution
/BuildSolution
.gitignore
README.md
This structure ensures that code, scripts, and configuration files are stored in clearly defined locations, minimizing confusion and improving workflow efficiency.
What Each Folder Is For
App/SourceCode
This folder is where all custom modules for the client are stored. Each module is kept in its own subfolder, which helps maintain a clear separation between functionalities and simplifies version control. Details about the recommended structure within individual modules will be covered in a future post.
App/BinaryOnly
Modules or libraries provided as binaries, such as ISV solutions or third-party components, belong here. This separation prevents accidental modifications and ensures updates to such packages can be managed independently.
App/CustomScript
This folder holds custom X++ scripts designed to be executed directly in the client’s production environment. These scripts are typically used to address urgent issues or apply specific fixes. For more information on creating and running these scripts, refer to Microsoft’s documentation.
App/License
If specific license files are required for individual modules, they can be organized in this folder, making them easy to locate and manage.
Pipeline
All CI/CD pipeline configurations, such as YAML files for build and deployment automation, are stored here. Centralizing pipeline definitions simplifies updates and ensures consistency across environments. In some cases, pipelines might even be maintained in a separate repository, creating a clear distinction between application code and operational administration.
Solution
The Visual Studio solution file and associated project files are located in this folder. Subfolders, such as BuildSolution, can be used for CI/CD-specific configurations.
.gitignore and README.md
The .gitignore file is essential for keeping unwanted files out of version control. This might include local development artifacts or temporary files.
The README.md provides a quick overview of the repository structure, explaining its purpose and key details to new developers or contributors.
Practical Considerations
Clarity Over Complexity
Avoid over-complicating the structure. The goal is to strike a balance between enough organization to manage complexity and not so much that it becomes cumbersome.
Adaptation to Team Needs
While this structure works as a baseline, adjust it to suit your team’s workflow. For example, teams heavily involved in automated testing might include a dedicated folder for test data and configurations.
Cross-Team Consistency
If multiple projects or repositories are being managed, standardizing folder structures across all of them improves clarity for developers switching between projects.
Conclusion
A well-organized folder structure is an investment in the long-term health of your Dynamics 365 FO projects. By using a structure like the one outlined above, you ensure that everyone on the team can find what they need and contribute effectively. While some customization may be required, starting with a solid foundation helps avoid common pitfalls.