Managed vs Unmanaged Solutions Best Practices

Loading

When working with Microsoft Dynamics 365 and Power Platform, one of the key considerations in solution development and deployment is deciding whether to use managed or unmanaged solutions. Both solution types have their advantages, and understanding when and how to use each is crucial for ensuring the stability, maintainability, and scalability of your Dynamics 365 applications.

In this article, we will explore the differences between managed and unmanaged solutions, dive into their respective use cases, and provide best practices for developers and administrators. Whether you’re deploying a custom solution, managing a production environment, or working in a development lifecycle, understanding the nuances of managed versus unmanaged solutions will help you make informed decisions that support the long-term success of your Dynamics 365 implementations.

What Are Managed and Unmanaged Solutions?

1. Unmanaged Solutions

An unmanaged solution is a solution that allows full access and modification of its components. These solutions are typically used in development environments, where developers are actively building and customizing components. The key feature of unmanaged solutions is that components can be directly edited, deleted, or modified within the solution.

Key characteristics of unmanaged solutions:

  • Development Focused: Typically used in development and testing environments.
  • Editable Components: Components can be directly modified, deleted, or added without restrictions.
  • No Versioning: Changes made within an unmanaged solution are not version-controlled.
  • No Overwriting: Unmanaged solutions can be merged with other unmanaged solutions, and no components are overwritten when importing a new solution.

2. Managed Solutions

Managed solutions are intended for deployment to production environments. These solutions are more controlled, offering greater stability and a more rigid structure. Once a managed solution is deployed, you cannot directly modify its components in the target environment. Managed solutions provide versioning and can be exported and imported, with careful management of dependencies.

Key characteristics of managed solutions:

  • Production Focused: Typically used in production or pre-production environments.
  • Locked Components: Once deployed, components cannot be modified within the solution, ensuring a controlled environment.
  • Versioning Support: Managed solutions can include versioning, which allows you to track and control changes to the solution.
  • Solution Overwriting: When importing a new version of a managed solution, the system can overwrite existing components.
  • Managed Properties: Certain properties, like default values, can be controlled through managed solutions.

When to Use Managed Solutions vs Unmanaged Solutions

The decision to use a managed or unmanaged solution depends on the stage of development, deployment needs, and the environment in which the solution will reside.

1. Unmanaged Solutions: Best Used in Development and Customization Stages

Unmanaged solutions are ideal during the early stages of development, customization, and testing. These solutions are typically used in environments where you need flexibility and control over the solution components.

Use Cases for Unmanaged Solutions:

  • Development Environment: When actively developing and testing components like custom entities, forms, workflows, or plugins, unmanaged solutions allow for easier iteration and modification.
  • Customization: For environments where you’re iterating on customization, you need the ability to quickly make changes to solution components without worrying about the rigidity of managed solutions.
  • Merging Changes: Unmanaged solutions are more flexible when multiple developers are working on different parts of a solution, as changes can be merged without worrying about overwriting existing components.
  • Faster Deployment: Since components within an unmanaged solution are not locked, you can deploy changes and test them quickly without dealing with the restrictions of managed solutions.

2. Managed Solutions: Best Used in Production Environments

Managed solutions are designed for production environments where stability, security, and version control are paramount. Once a solution is fully developed and ready for deployment, it should be exported as a managed solution for consistency and safety in the target environment.

Use Cases for Managed Solutions:

  • Production Environments: Managed solutions are ideal for production environments, as they provide stability by locking down components, preventing unintended modifications.
  • Solution Deployment: Managed solutions allow for controlled deployments, ensuring that components are not modified after deployment and reducing the risk of introducing bugs.
  • Version Control: If your organization requires versioning of solutions, managed solutions provide a structured way to manage updates and changes. When you import a new version of a managed solution, you can ensure that the old version is either upgraded or replaced with a newer version.
  • Solution Dependencies: Managed solutions help manage dependencies between components, ensuring that all required components are included in the solution package before deployment.
  • Partner or ISV Solutions: Independent Software Vendors (ISVs) or third-party vendors typically use managed solutions to distribute their solutions, as these provide the necessary control and security.

Best Practices for Working with Managed and Unmanaged Solutions

Whether you’re working in a development or production environment, there are several best practices you should follow to ensure that you’re using both managed and unmanaged solutions effectively. Let’s take a closer look at these best practices for developers and administrators.

Best Practices for Unmanaged Solutions

  1. Use Unmanaged Solutions for Development and Customization As unmanaged solutions allow you to modify components directly, they are ideal for building and customizing your application. During the early stages of development, you may need to add new entities, modify forms, and adjust workflows. Since you can make quick changes, you save time and avoid the restrictions of a managed solution.
  2. Ensure Proper Version Control for Custom Code While unmanaged solutions do not have built-in version control, it’s still important to use source control tools (such as Git) for custom code. Store all JavaScript files, plugins, and other custom code in a version-controlled repository. This allows you to manage and track changes to your custom components.
  3. Migrate to Managed Solutions for Production Once you’ve completed development and customization, it’s important to migrate to a managed solution when moving to production. This ensures that no accidental modifications occur within the production environment. You can export your unmanaged solution as a managed solution before deploying it to the target environment.
  4. Limit the Use of Unmanaged Solutions in Production Avoid using unmanaged solutions in production environments. While they offer flexibility in development, they can lead to issues in production due to the ability to directly modify components. Unmanaged solutions also lack the ability to track changes, making it difficult to manage versioning or maintain a reliable deployment pipeline.

Best Practices for Managed Solutions

  1. Use Managed Solutions for Production Environments Once your solution is finalized, export it as a managed solution and deploy it to your production environment. Managed solutions lock components down, ensuring that no changes are made directly in the target environment. This prevents accidental changes and maintains system stability.
  2. Plan for Solution Updates and Versioning Managed solutions support versioning, so it’s important to plan for future updates. When updating a managed solution, you must ensure that all dependencies are addressed and that you properly upgrade the solution version in the target environment. Always keep track of the versions to avoid overwriting important components or causing version conflicts.
  3. Use Solution Layers Effectively In managed solutions, components are layered to ensure that updates do not affect existing functionality. Layers are created when you apply a managed solution update, ensuring that new changes are added on top of the previous version without overwriting it. This layering allows for safe updates without loss of data or functionality.
  4. Consider Solution Dependencies Ensure that all components within the managed solution are properly packaged with all their dependencies. For example, if you have a custom entity that depends on a custom workflow, both components should be included in the solution. This helps prevent missing dependencies when importing solutions into other environments.
  5. Test Managed Solutions in a Sandbox Environment Before deploying a managed solution to production, test it in a sandbox or testing environment to ensure that the solution works as expected. Testing will help you catch any issues that may have been missed during development and prevent disruptions in your production environment.
  6. Avoid Modifications After Deployment Once a managed solution is deployed to production, avoid making changes directly in the solution in the target environment. Instead, update the solution in your development environment, export a new version as a managed solution, and import it into the production environment. This ensures the integrity of the solution and prevents conflicts between different versions of the solution.

7. Use Managed Solutions for ISV or Partner Solutions

If you’re working with ISV (Independent Software Vendor) solutions or partner solutions, they will typically come as managed solutions. These solutions are designed to be deployed in a production environment where the vendor controls the solution’s functionality. Avoid making changes to these solutions unless specifically allowed by the vendor.

Leave a Reply

Your email address will not be published. Required fields are marked *