Azure DevOps CICD Pipelines
Using Azure DevOps CICD Pipelines with DecisionRules Business Rules Engine
Introduction
This tutorial will guide you through setting up two CI/CD pipelines using Azure DevOps CICD Pipelines to automate the management of business rules in DecisionRules. The first pipeline will handle moving business rules from one DecisionRules space to another, even across different environments (e.g., from development to production). The second pipeline will focus on Restore-in-Time Recovery, allowing you to revert to a previous state of your business rules when necessary.
Prerequisites
Before starting, ensure the following:
Azure DevOps account and project set up.
DecisionRules account with API access.
A Git repository with your DecisionRules configurations and rules.
Access to a Service Principal with appropriate permissions in Azure DevOps.

Pipeline 1: Moving DecisionRules Business Rules Between Spaces/Environments
This pipeline will automate moving business rules from one space in DecisionRules to another, supporting deployment across different environments such as development, staging, and production.
Step 1: Create a New Azure DevOps Pipeline
Navigate to your Azure DevOps project.
Go to Pipelines in the side panel, then select Create Pipeline.
Choose where your code is hosted (e.g., GitHub, Azure Repos).
Select the repository where your DecisionRules configuration and rules are stored.
Choose the Starter Pipeline or define a YAML pipeline.
Step 2: Configure YAML Pipeline for DecisionRules Deployment
Optional: Comparison of Source and Destionation Spaces
If you want more control over what is being overwritten in the destination space you can compare the exports of both spaces. Using the pipeline in the appendix
The YAML configuration below automates the transfer of business rules between spaces:
Step 3: Set Up Variables
In Azure DevOps, navigate to Pipelines > Library > Variable Groups.
Create Variable group dr-var

Add the following variables:
GIT_REPO: Git repository where backups are stored*_ENV_URL: URL of environment endpoint. This endpoint can be named i.e. as PRODUCTION, DEV, TEST, etc. This prefix is then selected in pipelines parameters section:
*_SPACE_MANAGEMENT_KEY: Decision Rules Management API key that identifies the space on DecisionRules environment
Step 4: Trigger and Monitor the Pipeline



Once set up, you can trigger this pipeline through code commits or manually and monitor the status from the Pipelines page.
Pipeline 2: Restore-in-Time Recovery Pipeline
This pipeline will allow you to revert to a previous version of a business rule, enabling a restore-in-time recovery for DecisionRules.
Step 1: Create a New Pipeline for Recovery
Follow the same steps as above to create a new pipeline in Azure DevOps.
Name it something like Restore-In-Time Pipeline.
Step 2: Configure YAML Pipeline for Rule Restoration
Here’s the YAML configuration for the restore pipeline:
Step 4: Trigger and Monitor the Pipeline


Appendix
Pipeline Example with comparison of Space
To add comparison of spaces and a manual review requirement we need to add environments to our pipelines.
How to:
Navigate to your Azure DevOps project.
Go to Pipelines/Environments in the side panel.
Create two new environments named DecisionRules-PRODUCTION and DecisionRules-TEST.
Open each of the envrionments and under Approvals and Checks add a manual review and the necessary reviewers


Then use the following pipeline. This pipeline will export both source and destination spaces, compare them and give you an overview (also available as a .json artifact) of what rules have changed between the environments. You can then go over those rules to look for suspicious or unrecognised changes.

The reviewers will be notified via email to review the pipeline. The review approval is necessary for the pipeline to continue and overwrite the destination Space.

Conclusion
By setting up these two Azure DevOps pipelines—one for moving business rules between spaces (optionally comparing them) and the other for time-based recovery—you can effectively automate rule management in DecisionRules. These pipelines will help you maintain consistent deployments, streamline environment management, and offer the ability to quickly revert to a previous rule state when needed.
Last updated