assessmenttransfer
Command: assessmenttransfer
Copies one named Dynamic Assessment's configuration from a source environment into a target environment: the assessment, its published version, and everything that version needs to render — pages, sections, questions, option sets and their items, the scoring subtree, validation rules, and diagram images.
Records keep the identifiers they have in the source environment, so the same assessment is recognisable as the same assessment in both. Re-running is safe and is the intended way to recover from a failed run: a record that already matches plans as no change.
.\WhanauTahi.Xpm.Tooling.CLI.exe assessmenttransfer `
--SourceUrl "https://source.crm6.dynamics.com" `
--TargetUrl "https://target.crm6.dynamics.com" `
--Assessment "Family Information" `
--AuthConfig .\authConfig.json
Parameters
| Parameter | Required | Description |
|---|---|---|
--SourceUrl |
Yes | Environment to copy from. Only ever read; the command has no way to write to it. |
--TargetUrl |
Yes | Environment to copy into. Must be a different environment from the source. |
--Assessment |
Yes | The assessment name, matched exactly (after trimming) against the assessment record. |
--AuthConfig |
No | Path to the service principal json. Defaults to ./authConfig.json. |
--Apply |
No | Actually write. Without it the run is a dry run and writes nothing. |
--Yes |
No | Skip the confirmation prompt when applying. For scripted runs. |
Authentication
Unlike the other commands, assessmenttransfer does not take --ClientId and --Secret: it reads
both from a json file, because one run authenticates against two environments.
{
"applicationId": "12345678-1234-1234-1234-123456789abc",
"clientSecret": "<the client secret>"
}
The service principal must be an application user in both environments — read in source, and create/update/delete plus publish in target. The file is never printed, and there is no fallback credential: if it is missing, malformed or incomplete the run stops before either environment is contacted. Keep it out of source control.
No tenant is named anywhere, deliberately. Each environment is asked which directory it answers to, so a source and a target in different tenants both work as long as the one application registration is consented into both.
Dry run by default
A run without --Apply reads both environments, prints the full change set, writes nothing, and ends
with DRY RUN — nothing was written.
With --Apply, the same report is printed and you are asked to confirm before anything is written, so
the report you approve is the report that runs. --Yes answers that prompt for scripted runs.
After applying, the transfer checks itself: it re-reads the assessment from target, compares it with source, rebuilds anything that did not regenerate, and plans the whole transfer again. A converged transfer plans as nothing at all — that is the proof it finished.
Exit Codes
| Code | Description |
|---|---|
| 0 | Succeeded — a clean dry run, or an applied transfer that verified as converged |
| 1 | Failed or refused — a pre-flight failure, a bad auth config, or target still disagreeing with source after the final pass. Nothing partial is left unexplained; re-run once the cause is fixed |
| 2 | The operator answered no at the confirmation prompt |
A script can therefore tell "they said no" from "it went wrong".
What it never does
- It never writes to the source environment. Source is reached through a wrapper with no write operations on it, so this is a property of the code rather than a promise.
- It never touches assessment instances, question responses, or plans. Completed and in-progress assessments in target are unaffected: each instance carries its own snapshot of the definition it was started with, so historic assessments keep rendering exactly as they were filled in.
- It never merges by name. The assessment itself is matched by name; everything below it is matched by identifier. If a name is ambiguous the run stops and lists the candidates rather than guessing.
Two things the target environment must provide itself
- The Dynamic Assessments v2 organisation setting. Assessments only render through the v2 experience where that setting is on, and no transfer can carry environment configuration.
- An active Activity Register row for Dynamic Assessment, which is what gives a plan the button that starts an assessment. The run warns when it is missing; without it a transferred assessment arrives complete but cannot be started.