Tuesday, May 2, 2017

Managing Solutions in Dynamics 365 - Part-1

Solution deployment is always a major concern for Dynamics 365 projects. This blog is to discuss the OOTB options available for Solution management and focuses on Managed solution deployments in an online environment.

In a typical Dynamics 365 project you can have multiple deployments as the software customization code is moved using solutions from one environment to another.

Consider a solution as a bucket of components. Components is customization's done based on user story / requirements. So each solution is basically a group of user requirements delivered to environments for QA and UAT testing and finally deployed to Production.



Effective Solution management requires -

1. Ability to identify, track and control the solution versions deployed in each environment
2. Ability to differentiate between the software codes deployments between multiple environments
3. Ability to uninstall (rollback) to an earlier version if an error is detected in the current version of the solution (using managed solutions)
4. Ability to map and connect user story (requirements) to software customization's (components) 

Solution Types

There are 2 types of Solutions –

1. Managed Solutions
2. Unmanaged Solution

Most of the code deployments in the past versions of Dynamics 365 (CRM) was done using unmanaged solution. It was a challenge to work with Managed solution in a production environment. Also managed solution were mainly used by ISV’s for add-on package software distribution by Microsoft partners.

Some of the risks involved with using unmanaged solution in Production are –

1. It is difficult to control the code getting modified in a non-development environment.
2. It is not possible to roll back or undo the changes made with an unmanaged solution
3. Deleting an unmanaged solution does not delete the customization's in the solution

There are advantages to using Managed solutions -

1. A managed solution only includes solution components that have been customized.

1.1         This prevents unintentionally changing existing solution components on the system where the                                      solution is installed,
1.2         It also keeps the size of the managed solution smaller.

2. Managed solution helps in keeping control over any changes made in the non-development environments. 

You can defined what custom component can or cannot be customized in the managed environment. The managed properties have to be set in the unmanaged solution before exporting as managed solution.

3. Versioning and patching / updating is useful and easy to manage with OOTB functionality.

Risks involved with Managed solution – 

If a managed solution is deleted it deletes the following –

               1. All data stored in custom entities that are part of the managed solution

               2. All data stored in custom fields of system entities that are part of the managed solution

Hence it is never a good idea to uninstall or delete a managed solution as it will delete the data. You can update the managed solution thus maintaining the data.

Details about versioning, patching and updating managed solutions will be discussed in my next blog – Managing Solutions in Dynamics 365 Part-2.

Multiple Solutions –

Agile projects have a continuous development cycle. The solution will grow in size and complexity. It also requires multiple releases to production. It is a good practice to divide the solution into different multiple solutions so it is easy to manage and move from one environment to another. 

For example – You can divide your customizations and configuration components into 2 different solutions. It is also a good practice to have a separate solution for Security Roles to avoid user issues implications during deployments. So there can be multiple solutions like - Configurations / Customization's / Security Roles etc.

Resolving conflicts -

There can be a plethora of solutions OOTB from Microsoft (the last time I counted it has @14 managed solutions if you include all options), ISV solutions and custom development solutions which can be managed and / or unmanaged. 

It is important to understand how Dynamics 365 will resolve conflicts. The figure below shows how the different solutions interact with the System solutions resulting in the final application behavior. The system solution is the default OOTB solution. Managed solutions and Unmanaged customization's determine what the user will finally visualize and experience.


When there are multiple solutions Dynamics 365 will resolve conflicts using the two strategies – Merge and Top Wins. 

1. Merge – All UI components are re-calculated and merged from bottom to top. The unmanaged customization are last to be displayed.

2. Top Wins – All other non UI customization's the conflicts is resolved based on the solution components that is applied last.




Update to a Managed solution does not follow the above rule. 

If unmanaged customization's already exists for updates made to a managed solution, the user may not see the updated changes in the organization. The user will be given an option when updating the Managed solution whether to overwrite or preserve any existing customization's on top of the Managed solution. 

In addition the following is to be noted for updates to managed solutions
               1. Forms merging – Any form customization's may need to be further customized after the updates are published. 
                  
               2. Site Map – Site map customization's need to be verified and further changes may be needed as they are also                            getting merged.

In my experience it is better to have a pre-production staging environment to do a complete test before the solutions are deployed to production.

I hope the above helps in understanding and managing solutions. In my next part II of this blog I will write about the solution versioning and patching options.  
Let me know your past experience with solutions and if you are using Managed solutions for deployments.

Thanks for reading.

Mihir Shah

No comments:

Post a Comment

Please add your comments and feedback. Thanks for reading.