Klevr Product Documentation logo

Create Deployment Files

How to create the admins file, the domains file and the YAML deployment pipeline files that define where and how Integration Hub is deployed.

Walkerscott does the steps on this page when we set up Integration Hub with you. They are here for reference. Your tasks are listed in Setup.

The deployment files are kept in the Business Unit directory of the Integration Hub repository. The integration definitions are kept separately, in the interfaces directory.

{businessUnitCode}
admins.json
domains.json
staging.yaml
production.yaml
FileRequiredWhat it defines
admins.jsonNo, but recommendedThe Integration Hub Portal administrators for each environment.
domains.jsonYesThe Domains to deploy in each environment, and their settings.
{environment}.yamlYes, one for each environmentThe deployment pipeline for the environment, for example staging.yaml and production.yaml.

Create each file as described in the steps below.

1

Create the Admins File

The admins file defines the administrators of the Integration Hub Portal for each environment. Administrators can see every Domain, and can manage all other portal users on the User Admin page. This is the recommended way to manage portal access.

The file is optional, but without it nobody can use the User Admin page. Create it in the Business Unit directory.

The file has one property for each environment. The property name must be the same as the value of the environment variable for that environment, for example staging or production. Each environment has an IntegrationHub list of administrators, with these properties:

PropertyDescription
emailThe email address of the administrator's Entra ID account. Required.
nameThe name to show in the portal.
{
  "staging": {
    "IntegrationHub": [
      { "email": "admin.user@example.com", "name": "Admin User" }
    ]
  },
  "production": {
    "IntegrationHub": [
      { "email": "admin.user@example.com", "name": "Admin User" },
      { "email": "another.admin@example.com", "name": "Another Admin" }
    ]
  }
}

On each deployment of the Integration Hub Portal:

  • Each administrator listed for the environment gets a portal account with the Admin access level, if they do not already have it.
  • An administrator who was added from this file, but is no longer listed, loses the Admin access level. Their account stays, so any Domain access that they were given in another way stays too.
  • An environment that has no property in the file is not changed. To remove all administrators from this file for an environment, keep the property with an empty IntegrationHub list.

Administrators from this file are read-only on the User Admin page. To change them, change the file and run the deployment again.

Other Klevr products can also use this file, with their own lists (for example IdentityDNA). Integration Hub uses only the IntegrationHub list.

2

Create the Domains File

In Integration Hub, the mid-level of the organisational structure is called a Domain.

In the Business Unit directory, create a domains.json file that contains the Domain details for the Integration Hub instance.

The file needs to contain the Domain configuration for each environment that will be deployed. This makes it possible to have different configurations for a given Domain by environment.

The file needs to be a JSON file, not a Bicep file.

The deployMode, apiManagementDeployMode, and logicAppDeployMode options are used for all Domains in the Business Unit. If you need to deploy integrations using different deployment modes, you will need to deploy these integrations in different Business Units.

When specifying the deployment mode, please either:

  • Set only the deployMode parameter; or
  • Set both the apiManagementDeployMode and logicAppDeployMode parameters.
{ 
  "deployMode": "Standard | Consumption",
  "apiManagementDeployMode": "Basic | Consuption",
  "logicAppDeployMode": "Standard | Consumption",
  "staging": [
    {
      "code": "dm1",
      "name": "Domain 1",
      "portalUsers": [
        "name1@example.com"
      ],
      "keyVaultAdmins": [
        {
          "objectId": "00000000-0000-0000-0000-000000000001",
          "name": "Integration Consultants (Entra group)"
        }
      ],
      "smsReceivers": [],
      "emailReceivers": [
        {
          "name": "Name 1",
          "emailAddress": "name1@example.com"
        }   
      ],
      "deployStorageServices": true,
      "cosmosDBs": [
        {
          "sqlDBName": "CosmosDbName",
          "containers": [
            {
              "containerName": "CosmosContainerName",
              "partitionKey": "/SomeKey",
              "TTL": -1
            }
          ]
        }
      ]
    },
    {
      "code": "dm2",
      "name": "Domain 2",
      "portalUsers": [],
      "smsReceivers": [],
      "emailReceivers": [
        {
          "name": "Name 2",
          "emailAddress": "name2@example.com"
        }   
      ],
      "deployStorageServices": false,
      "cosmosDBs": []    
    }
  ],
  "production": [
    {
      "code": "dm1",
      "name": "Domain 1",
      "portalUsers": [
        "name1@example.com",
        "another.name@example.com"
      ],
      "smsReceivers": [
        {
          "name": "Name 1",
          "countryCode": "+61",
          "phoneNumber": "0415111111"
        }
      ],
      "emailReceivers": [
        {
          "name": "Name 1",
          "emailAddress": "name1@example.com"
        },
        {
          "name": "Another Name",
          "emailAddress": "another.name@example.com"
        }   
      ],
      "deployStorageServices": false,
      "cosmosDBs": []    
    }
  ]
}

Portal Users

The portalUsers property is optional. It lists the email addresses of users who can see the Domain in the Integration Hub Portal, with the User access level.

  • Each email address must be the email address of the user's Entra ID account.
  • A user removed from the list loses access to the Domain at the next deployment.
  • These users are read-only on the portal User Admin page. Change them in this file.
  • A deployment that uses ONLYDEPLOYDOMAINS does not change the access of users to Domains that it does not deploy.

Using portalUsers to manage portal users is no longer the recommended approach. Instead:

  1. Use the admins file to define a small, fixed set of administrators for each environment.
  2. Have those administrators manage all other users, and the Domains that each user can see, on the portal User Admin page.

You do not need to list administrators in portalUsers, because administrators can see every Domain. The portalUsers property is still supported, so existing domains.json files keep working.

Key Vault Admins

The keyVaultAdmins property is optional. It lists the Entra ID users, groups or service principals that can manage secrets in the Domain's Key Vault, for example the consultants who create the Key Vault secrets that stages read with $kv: tokens.

PropertyDescription
objectIdThe Entra ID object ID of the user, group or service principal, from the tenant that owns the Azure subscription. Required.
nameA name that tells you who the entry is for.
  • Each entry can get, list, set, delete, recover, back up and restore secrets. It cannot purge secrets.
  • Use an Entra group where you can, so that people can be added or removed in Entra ID without a deployment.
  • The deployment replaces all access policies on the Key Vault. An access policy that is added by hand is removed by the next deployment, so list it here instead.
  • An entry removed from the list loses its access at the next deployment.
  • Pre-flight validation stops the deployment when an objectId is missing, is not a GUID, or is listed more than once.

Deploy Storage Services

The deployStorageServices property is optional and defaults to false. Set it to true for a Domain to deploy these Azure resources for the Domain:

  • A Cosmos DB account.
  • A Storage Account with an associated Azure CDN profile and endpoint.

The Cosmos DB account is required by the Cosmos DB stages:

The Storage Account and associated Azure CDN profile are only required by the useCDN option of the Store Cosmos DB Upsert Stage. No other stage supports useCDN.

When deployStorageServices is false, the cosmosDBs list for the Domain is ignored.

Cosmos DB Settings

The cosmosDBs property lists the Cosmos DB databases, and the containers inside them, to create in the Domain's Cosmos DB account. It is only used when deployStorageServices is true.

PropertyDescription
sqlDBNameThe name of the Cosmos DB database. Stages refer to this value with cdb.databaseId.
containersThe list of containers to create in the database.
containerNameThe name of the container. Stages refer to this value with cdb.containerId.
partitionKeyThe partition key path for the container, for example /SomeKey. Documents stored in the container must include a top-level property with this name. The path cannot be changed after the container is created.
TTLThe default time to live, in seconds, for documents in the container. Use -1 to keep documents with no expiry.

A stage that uses Cosmos DB must match the Domain's domains.json file:

  • The cdb.databaseId value must match a sqlDBName value in the Domain.
  • The cdb.containerId value must match a containerName value in that database.
  • If the stage sets cdb.partitionKey, it must match the partitionKey value of the container.

These checks are case-insensitive. The pre-deployment tests report a mismatch before the deployment starts.

For each container, Integration Hub also creates a <containerName>Webhooks container (partition key /callbackUrl) and a <containerName>Lease container (partition key /id). These containers support webhook registration and use the same TTL value as the main container. You do not need to define them in domains.json.

3

Create YAML Deployment Pipeline Files

Create a YAML deployment pipeline for each environment required.

Generally, just a staging and production environment are required.

The staging environment is where updates to integrations are tested.

The production environment is where actual production integrations run.

Take care to review and update the file appropriately.

# Set the name as per the "Business Unit" and environment.
name: infra-wsc-ih-staging-$(Date:yyyyMMdd)$(Rev:.r)

variables:
  # Set the group name as per the "Business Unit" and environment.
 - group: S-WSC-IH

trigger:
  batch: true
  branches:
    include:
      # Set the trigger to use the branch name that matches the environment
      - staging

resources:
  repositories:
    - repository: klv-ih-core
      type: git
      name: Klevr Apps/klv-ih-core
      endpoint: Customer_Klevr_Service_Connection
      ref: refs/heads/main
    - repository: klv-ih-portal
      type: git
      name: Klevr Apps/klv-ih-portal
      endpoint: Customer_Klevr_Service_Connection
      ref: refs/heads/main

stages: 

# Use the common "deploytemplate.yml" to deploy the Integration Hub
- template: pipeline/deploytemplate.yml@klv-ih-core
  parameters:
    # Set the variable group name as per the "Business Unit" and environment.
    variableGroupName: S-WSC-IH

Using Specific Integration Hub Versions

As a general rule, an Integration Hub instance should use the latest release of the core Klevr Integration Hub service code, which will be in the klv-ih-core repository's main branch, and the latest release of the core Klevr Integration Hub Portal service code, which will be in the klv-ih-portal repository's main branch.

However, there may be instances where an Integration Hub instance needs to use something other than the latest release.

In this case, update the ref section in the YAML deployment pipeline file to select the specific branch or commit of the core Klevr Integration Hub service code that is needed.

Last updated on