midPoint configuration as code across dev, test and production

How to keep midPoint configuration in Git as XML files, separate environment-specific values from shared objects, and promote changes from dev to test to production without drift.

On this page

Why midPoint configuration as code matters across environments

A midPoint team often starts by configuring its development environment through the web interface: a resource here, a role there, a few mappings tuned by hand. Months later, test and production no longer match, and nobody can say which change was made where. Configuration as code addresses this. You keep midPoint configuration objects as XML files in Git, then import the same files into each environment, supplying the environment-specific values (such as resource connection parameters) separately. Evolveum recommends maintaining configuration objects as files for backup and versioning in systems such as Git, so that the same roles can be imported into test and production with different resource connection parameters (Evolveum documentation on maintaining midPoint configuration as files).

The practice covers four things: the XML object files themselves, static OIDs that keep each object's identifier identical in every environment, expression constants that hold values such as host names outside the configuration objects, and an import order that creates dependencies such as resources and archetypes before the roles and users that reference them. Teams need this once more than one environment exists or once an audit asks how a production change was approved and tested. Confirm with your own environment inventory which objects will live in Git and which, such as user data from an HR source, will never be exported this way. Note that this page does not cover the overlay project for code-level changes, the connector signature and allowed-connector process, or the operational steps of running the repository, which have their own sections.

What belongs in Git and what stays environment-specific

A midPoint configuration repository mixes components that travel unchanged between environments with values that must differ per environment. Sorting each component into one of those two groups is the first decision in any configuration-as-code setup.

Role and archetype objects

Roles, archetypes and their inducements define what access means in your organization, so they are shared across dev, test and production. Store them as files in Git and import the same definitions into each environment. Changes should go through review and promotion, not direct edits in the production user interface. Check that roles refer to resources by stable identifiers, because a role that points at a per-environment object will break on import.

Configuration as files docs

Object templates and mappings

Object templates and mappings encode the joiner, mover and leaver logic, so they are shared and should behave identically in every environment. Test them in dev and test with representative data before promotion. Watch for expressions that reference host names or paths directly, since those belong in expression constants instead. Keep a changelog entry for each template change so auditors can trace when a rule changed.

Resource definitions and placeholders

Resource definitions describe how midPoint connects to a target system, and their connection parameters differ by environment: host names, ports, service accounts and base contexts. Keep the resource structure and schema handling in Git, and replace environment values with placeholders or constants during import. Never commit bind passwords or service account secrets to the repository. Confirm with the vendor and your own environment which connection values must be supplied at import time.

Expression constants for environment values

Expression constants hold values such as host names that vary by environment, and they sit outside the shared configuration objects. Define the same constant names in every environment and set only the values per environment. This keeps role and mapping files identical across stages. Check that every constant referenced in shared objects exists in each target environment before importing, or expressions will fail at runtime.

Current midPoint features

Tasks and scheduling

Tasks such as reconciliation and live synchronization decide when and how often midPoint touches target systems, which makes them risky to copy blindly. Treat task definitions as configuration that you review, but set schedules and enablement per environment so test runs do not reconcile against production resources. Confirm with the Evolveum maintenance docs for your deployed version which task states survive an import.

Export and import commands

The exact export and import commands, and the object types they cover, change between midPoint versions. Before building a pipeline, confirm the procedure against the Evolveum maintenance docs for the version you deploy, and test a full export and re-import in a non-production environment. Record which version produced each set of files so that an upgrade does not silently change how objects serialize.

Configuration options for environment-specific values

This table compares three ways to keep values that differ between dev, test and production out of the shared configuration files. Read each row as a decision: when the option fits, what it costs to keep correct over time, and the risk it adds. The main takeaway is that expression constants keep the exported files portable, while separate per-environment objects multiply what must be reviewed.

OptionWhen it fitsMaintenance costRisk introduced
Separate resource objects per environmentFew resources and a small team that manages each environment's connection settings by handEach resource is edited and checked in every environment, and changes to shared mappings must be repeatedDrift between environments, and production settings copied into dev or test files by mistake
Expression constants for values such as host namesValues that change per environment but are referenced by many objects, such as host names and base URLsOne definition per environment, updated at import time, with the same exported role and resource files reusedA missing or wrong constant can break several objects at once, so each environment's constant set needs its own review
External file or secret referencesCredentials and values that must not sit in Git or in the midPoint repository in clear textSecret stores or mounted files must be provisioned and rotated for each environment, and the references kept in syncMisconfigured references can fail silently at runtime, and access to the secret store becomes a control to review
Shared files imported with different connection parametersRoles and most resources that should behave identically in every environmentFiles are versioned once in Git, and only the connection parameters are supplied per environmentRelies on the import process being repeatable and on the parameter set staying complete as the model grows

How to set up the Git workflow and promotion path

This sequence turns a working midPoint configuration into versioned files in Git, then moves those files through test to production with environment-specific values kept outside the shared objects. Each step closes with a check so the team can trust what gets promoted.

  1. Export a reference environment to files

    Start from the environment that holds the configuration you trust, usually the most complete non-production instance. Export the configuration objects that define your model, including roles, archetypes, object templates, resources and the system configuration, as XML files. Evolveum recommends keeping configuration objects as files for backup and versioning in systems such as Git. Commit the export as the first baseline, and record which midPoint version produced it. The step is done when the baseline commit can be imported into an empty test instance without errors.

  2. Assign and freeze static OIDs

    Objects must keep the same identifiers in every environment, or imports will create duplicates instead of updating existing objects. Confirm that each exported object carries a fixed OID, and where objects were created without one, assign an OID once and never change it afterward. Document the OID for each role, archetype and template in a short register kept beside the repository. The check is a second export from the same environment that shows identical OIDs for every object you intend to promote.

  3. Define expression constants per environment

    Move values that differ between environments, such as host names, endpoints and service account references, out of the shared objects and into expression constants. Each environment then sets its own values while the role and resource definitions stay identical. The team that owns the connected systems should supply these values and confirm them per environment. The check is that the exported files contain no environment-specific host names or credentials, and that a test import resolves every constant to a value you expect.

  4. Create the repository layout and review rules

    Organize the repository by object type and environment so reviewers can see what changes in each commit. Keep shared definitions in one place and per-environment values in separate files or parameter sets. Set branch protection so production changes need a second reviewer, and require that every change to a role or resource is linked to an approved request. The team lead and the identity governance owner should agree on these rules before the first promotion. The step is complete when a test change cannot reach the production branch without the required review.

  5. Import into test with test parameters

    Import the shared files into the test environment, applying that environment's constants and connection parameters. Use the same import method you plan to use in production so the test run validates the real procedure. Before importing, confirm in the test environment that target systems are reachable, that service accounts exist, and that no live provisioning is triggered against production systems. Afterward, review the import log for errors and warnings, then check that the imported objects match the baseline.

  6. Verify that a re-import causes no unintended changes

    Run the same import a second time with no changes in Git and compare the result with the first run. Export the test environment again and diff it against the repository. Differences should appear only where you intended a change, and any unexpected diff usually points to a runtime value, a missing constant or an object that was edited directly in the user interface. Fix the source files, not the target, and repeat until the re-import is idempotent. This check is the main safeguard against configuration drift.

  7. Promote to production after the same checks

    Promote the approved commit to production using the same import procedure that passed in test. Confirm in production that the constants and connection parameters match production values, that backups exist before the import, and that the change window and rollback plan are agreed in advance. After the import, run the same export and diff check used in test and record the production commit that is now deployed. The step is done when production matches the repository and that commit is recorded as the production baseline.

How to keep dev, test and production similar

Developers build and change roles, resources, mappings and object templates in the dev environment, then export them as files for review. Their main risk is drift: a change made through the GUI that never reaches Git, or a local tweak that only works on one developer's instance. Controls at this stage keep the exported files clean and predictable.

  • Naming conventions: agree names for roles, archetypes, resources and organizational units before the first object is created, so exported files are easy to diff and review.
  • Static OIDs: give core configuration objects fixed identifiers so the same object imports into every environment as an update, not a duplicate.
  • Version pinning: run the same midPoint release in dev as in test and production, and record it alongside the repository commit.
  • Schema parity: keep schema extensions in the same files and versions used everywhere, so no environment rejects objects the others accept.
  • Clean exports: export only the objects the change touches and remove environment-specific values before committing.

Check that a developer can rebuild dev from the repository and the documented release alone, without manual GUI steps.

How a configuration change moves from Git to production

A change starts as an edit made in the dev midPoint, is exported as XML files and committed to Git, then reviewed and merged. The test environment imports the same files with its own expression constants, where validation happens. Production imports the same reviewed files with production constants. Connection secrets never enter the repository. They stay in each environment and are referenced from there, so the trust boundary sits between Git and each midPoint instance.

Configuration moves through Git with environment values and secrets kept outside the repository.

Security and operational considerations for configuration files

Storing midPoint configuration as files moves part of the platform into a version control system, and that system then carries security weight. The four risks below cover what can leak, what can change without review, who can reach the repository, and what happens when the running system no longer matches the files.

Secrets committed to Git

Resource files and expression constants often sit next to passwords, bind credentials and connector keys. A single commit can expose them to everyone with repository access, and Git history keeps the value even after the file is edited. Check that exported objects are scrubbed of credentials before they are committed, that secrets come from a secret store or environment at import time, and that a secret scanner runs on every push. Confirm how the deployed midPoint version handles encrypted and protected values in exported files.

Configuration as files docs

Unreviewed role and authorization changes

Roles, archetypes, object templates and authorization objects decide who can do what in midPoint, so a small edit can grant broad access across every connected system. Require a second reviewer for any change under role, authorization or administrator definitions, and block direct pushes to the main branch. Diff each import against the last approved state before it reaches production. Ask the team which objects count as privileged and keep that list in the repository.

Access to the repository itself

Anyone who can write to the configuration repository can change midPoint behavior, possibly without touching the GUI or the admin account. Limit write access to named maintainers, enforce multi-factor sign-in on the Git hosting platform, and log pipeline and deploy-key use. Treat the import pipeline's service credentials as privileged accounts with their own rotation schedule. Align these controls with the administrator role and authorization practices in midPoint security hardening.

Drift from manual GUI edits

When an administrator changes a role or resource in the midPoint GUI, production can differ from the repository without anyone recording it. The next import from Git then overwrites the change, or the change stays unrecorded and the files become wrong. Decide which environments accept GUI edits, export objects back to the repository after any emergency change, and compare live objects with the files on a schedule. Document the procedure so that operators know the source of truth.

Pipeline and environment separation

Import jobs that push the same files into test and production can carry production credentials into a lower environment or the reverse. Give each environment its own connector parameters, keep them outside the shared files, and restrict which pipeline may target production. Confirm that the import tooling for your midPoint version can run without exposing production secrets to developers.

Verifying changes before release

Config files can pass review and still break a live identity flow, such as a mapping that disables accounts or a sync that deletes users. Run imports into a test environment with production-like data, check the resulting objects and any task outcomes, and keep a rollback path tied to the last approved commit. Record the midPoint version used for each import, because behavior and file formats can change between releases.

Questions teams ask before setting up configuration as code for midPoint

How much effort does midPoint configuration as code take to set up?

Effort depends mainly on how much configuration already lives only in the midPoint user interface and how many environments you need to keep aligned. Setup involves exporting roles, resources, object templates and other configuration objects to files, deciding how each environment supplies its own connection parameters, and agreeing on a Git branching and review process. Teams with a small, well-documented configuration usually spend most of the effort on cleanup and naming decisions, while teams with years of manual changes spend more time reconciling differences between environments. Ask any partner for a written breakdown of these tasks before agreeing to a scope.

Can our own team set up configuration as code for midPoint in-house?

Yes, a team with Git experience and at least one person who knows midPoint well can usually do it in-house, provided it has a non-production environment to test imports. The work sits close to midPoint administration, so the people doing it need to understand object types, OIDs and how expression constants are used. Teams without that depth often bring in a partner for the first pass, then keep the process themselves. Evolveum also sells subscriptions and training, which some teams use to build internal skills.

What skills and environments does configuration as code require from our team?

The team needs working knowledge of Git, including branches, merge requests and code review, plus midPoint administrators who can export objects and import them into a test system. A separate test environment matters because you cannot confirm that a set of files imports cleanly without running the import somewhere that is not production. Someone should also own the environment-specific values, such as host names and connection settings, so they are not hard-coded into shared files. Confirm your own tooling and access model before setup starts.

How does the size of the role model affect setup time?

The number of roles, organizational units, archetypes and object templates is the main driver of setup time. Each object type you keep in files needs an export, a review of its static OIDs and a test import, so a larger role model means more files to check and more dependencies to order correctly during import. Roles that reference other roles or resources need to be imported in a sequence that works in every environment. A small inventory of objects is typically a short exercise, while a large role model with many inducements benefits from a phased rollout by object type.

What changes when we upgrade the midPoint version?

An upgrade can change the XML format, the available object attributes and the behavior of expressions, so exported files may need review after each version step. Plan to re-export configuration from a freshly upgraded test environment, compare the output with your repository and confirm that imports still succeed. midPoint upgrades must step through supported versions, so the configuration process should be tested at each stop on the upgrade path. Check the release notes for the target version before changing any files.

How do we keep dev, test and production similar without copying secrets into Git?

Keep shared role definitions and policies in Git, and keep environment-specific values such as host names in expression constants or other environment settings that are not committed with secrets. Evolveum describes expression constants as the way to define environment-specific values outside configuration objects, so the same role can point at different systems in each environment. Credentials should come from a secrets process you control, never from files in the repository. Review each merge request for accidental hard-coded values.

What risks should we check before committing to this approach?

The main risks are drift between the repository and the live system, imports that partially fail, and environment-specific values leaking into shared files. Make the repository the reference only after you have confirmed that a full export and import cycle reproduces the test environment. Keep an audit trail of who imported what and when, and restrict who can run imports into production. Ask your partner or internal team to document a rollback approach, because a faulty import into a live identity system can affect many users.

How DeployOpen scopes configuration as code work for midPoint

DeployOpen scopes midPoint configuration as code work as a fixed-scope engagement with the written scope, deliverables and timeline agreed before any work starts. The scope usually covers four things: the Git repository layout for exported configuration objects, the list of environment constants that differ between dev, test and production, the import procedure that moves objects from one environment to the next, and the handover package that lets your own team run the process afterwards. Each of these is a decision you should make explicitly, because a vague scope is where configuration drift starts. DeployOpen is a Chainscore Labs company and works inside your infrastructure, so repository hosting, pipeline runners and access to the target environments stay under your control.

Ask the partner to show, in the written scope, which object types are exported as files (roles, archetypes, object templates, resources and so on), how folders map to environments, and who approves a change before it reaches production. Confirm that environment-specific values such as host names and connection parameters are held in expression constants and kept out of the shared objects, and that the import runbook names the exact steps, checks and rollback path. Your team should also confirm who owns the repository, who holds the import credentials, and how long the handover sessions and documentation take to deliver, since these are the items that determine whether the work can be maintained in-house.

Ongoing support, periodic reviews of drift between environments, and help with midPoint upgrades can be added as a retainer once the initial delivery is complete. Pricing is not published. A quote follows from the written scope, so the most useful request you can make is a scope document that lists object types, environments, the number of import pipelines, the handover format and the retainer options separately, allowing your finance and security teams to compare the one-time build with recurring support.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.