Adoxio.Dynamics.DevOps is a PowerShell module for performing DevOps activities for Dynamics 365 CE.
- Open Windows PowerShell and install the module from the PowerShell Gallery
Install-Module -Name Adoxio.Dynamics.DevOps -Scope CurrentUser
- Download and install the Dynamics 365 v9.x SDK
- Create an environment variable named
CRM_SDK_PATH
and set it to the folder path of the downloaded tools. The folder path to use is theTools
folder containing theConfigurationMigration
,CoreTools
,PackageDeployment
, andPluginRegistration
folder. This can be done in PowerShell by executing this code:[Environment]::SetEnvironmentVariable("CRM_SDK_PATH", "C:\Path\To\Tools", "User")
- Restart PowerShell for the new environment variable to take effect
Walkthrough instructions are available in the blog post Installing Adoxio.Dynamics.DevOps.
An abbreviated version is as follows:
- Open Windows PowerShell and install the module from the PowerShell Gallery
Install-Module -Name Adoxio.Dynamics.DevOps -Scope CurrentUser
- Download and install the Dynamics 365 v8.x SDK
- Create an environment variable named
CRM_SDK_PATH
and set it to the folder path of the extracted Dynamics 365 SDK folder on your computer. The folder path to use is theSDK
folder containing theBin
,Resources
,SampleCode
,Schemas
,Templates
, andTools
folders. This can be done in PowerShell by executing this code:[Environment]::SetEnvironmentVariable("CRM_SDK_PATH", "C:\Path\To\SDK", "User")
- Restart PowerShell for the new environment variable to take effect
This module includes the following functions that can be used individually to implement tailored scripting needs.
Packs and zips a folder of Configuration Migration tool generated files previously created from the Expand-CrmData
cmdlet.
Packages an unpacked CRM solution folder using the SolutionPackager tool.
Modifies a Configuration Migration tool schema file to control the list of entities and fields that are included during an export, and the settings to use when importing the records using the Configuration Migration tool and Package Deployer.
Extracts a Configuration Migration tool generated zip file and unpacks the .xml files into separate files and folders, where each entity is stored in its own folder and each record is stored in its own .xml file inside the entity folder.
Extracts a CRM solution file to its individual components using the SolutionPackager tool included in the Dynamics 365 SDK.
Extracts configuration data using the Configuration Migration Tool PowerShell module.
Exports a list of solutions from a CRM organization.
Imports a package to a Microsoft Dynamics CRM instance.
Creates an AppSource package.
This function creates a package for use with the Dynamics CRM Package deployer included in the Dynamics 365 SDK.
Deletes an existing on-premise CRM organization from a local CRM server.
Deletes an existing on-premise CRM organization from a remote CRM server.
Creates a new on-premise CRM organization on a local CRM server by restoring from a backup.
Creates a new on-premise CRM organization on a remote server by restoring from a backup.
This project includes prescriptive samples for defining a series of actions that manage the full lifecyle of exporting and importing customizations and data from Dynamics 365 organizations. The samples are a combination of declaritive configuration files and scripts that use the configuration files to execute exports and imports.
Walkthrough instructions are available in the following blog posts:
- Adding Adoxio.Dynamics.DevOps Scripts to a Project
- Scripted Solution Exports with Adoxio.Dynamics.DevOps
- Configuration Migration Tool Schema File Preparation using Adoxio.Dynamics.DevOps
An abbreviated version is as follows:
- Copy and rename the
samples/Advanced
folder from this project to the root of your own project with the namescripts
- Edit or create files inside the
CrmConnectionParameters
,ExportSettings
andImportSettings
folders to describe the environments, solutions, and data that will be used during exports and imports - Update the parameters at the top of the
Export.ps1
andImport.ps1
files to refer to the file names used in the previous step - Invoke the
Export.ps1
andImport.ps1
scripts to execute exports and imports
To load this project for making changes to the PowerShell module and samples, ensure that you have Git installed to obtain the source code, and Visual Studio 2017 with the PowerShell Tools for Visual Studio 2017 extension to easily view and edit the code.
- Clone the repository using Git:
git clone https://github.com/Adoxio/Adoxio.Dynamics.DevOps.git
- Open the
Adoxio.Dynamics.DevOps.sln
solution file in Visual Studio
The primary folders in this repository are:
-
/src/Adoxio.Dynamics.DevOps - the main PowerShell module implemented using advanced functions
-
/src/Adoxio.Dynamics.ImportPackage - a generic CRM Package used to import solutions and data with the Dynamics 365 SDK's Package Deployer
-
/samples - sample code for PowerShell scripts that perform imports and exports using the module
Support is available by submitting issues to this GitHub project.
This project uses the MIT license.
This project accepts community contributions through GitHub, following the inbound=outbound model as described in the GitHub Terms of Service:
Whenever you make a contribution to a repository containing notice of a license, you license your contribution under the same terms, and you agree that you have the right to license your contribution under those terms.
Please submit one pull request per issue so that we can easily identify and review the changes.