Extending Dynamics 365 Package Deployer
The Dynamics 365 Package Deployer is a great tool that allows you to move your customisations and data between environments in bulk.
It imports your solutions and data, and provides an API to hook your custom code up to this process at certain points. These hooks are as follows:
Custom code hooks for Dynamics 365 Package Deployer process
|Method Name||Execution Time|
||After the package deployer extension is initialized, before the solution import process.|
||Before importing each solution.|
||Before importing each solution, only if the solution that is being imported is already present in the target Dynamics 365 instance.|
||Before the solution import completes, if the sample data or flat files are being imported.|
||After the solution and data imports are completed.|
There are some special parameters and properties that you can set in some of these methods. These parameters and properties can be set to alter the deployment behaviour, such has enabling plug-ins and workflows disabled, overriding safety checks during data import, etc.
There are also some cool methods that lets you interfere with the user interface, such as the
RaiseFailEvent methods. These methods enables you to create your own progress items in the progress items pane, however they seem to be only effective after the solution import process begins.
Another cool property that is provided via the Dynamics 365 Package Deployer API is
RootControlDispatcher. This property allows you invoke logic in the Package Deployer’s main UI thread. This means, you can use your custom WPF user interface during a package deployment.
There is a lot of clever stuff that can be done using these extension points if you want to customise, enhance and automate the deployment process of your Dynamics 365 applications.