1. Configuration

Global environment configuration file

Version:

Each instance of the Commerce Engine contains a Global.json file that defines the global environment configuration ("Name": "GlobalEnvironment") for that Commerce Engine service. The content of the Global.json file is loaded into system memory when a Commerce Engine service starts. For example, the Global.json file contains the connection string that the Commerce Engine uses to make the initial connection to the Global database that the remainder of the configuration is loaded from.

The Global.json environment file is located in the C:\inetpub\wwwroot\<CommerceEngine>\wwwroot\bootstrap folder.

The following shows an example of the Global.json file that is included as part of the sample solution package Sitecore.Commerce.Engine.SDK. A description of the content of each section of the file follows.

Note

In your deployment, you should limit modifications to the Global.json file to the policies collection section, for example, to change a parameter value, or to add a new global configuration policy. This applies to any Commerce Engine environment configuration files.

{
  "$type": "Sitecore.Commerce.Core.CommerceEnvironment, Sitecore.Commerce.Core",
  "Id": "GlobalEnvironment",
  "ArtifactStoreId": "{6be385f1-93dc-4299-9dd4-934f6ba42eaa}",
  "IsPersisted": false,
  "Name": "GlobalEnvironment",
  "Policies": {
    "$type":  System.Collections.ObjectModel.ReadOnlyCollection`1[[Sitecore.Commerce.Core.Policy, Sitecore.Commerce.Core]], mscorlib",
    "$values": [
      {
        "$type": "Sitecore.Commerce.Plugin.Management.ManagementCachePolicy, Sitecore.Commerce.Plugin.Management",
        "CurrencySetsCacheName": "CurrencySets",
        "FulfillmentCacheName": "Fulfillment",
        "PaymentsCacheName": "Payments",
        "CountriesCacheName": "Countries",
        "ItemsCollectionCacheName": "ItemsCollection",
        "ItemsCacheName": "Items",
        "Expiration": 86400000,
        "AllowCaching": true
      },
      {
        "$type": "Sitecore.Commerce.Plugin.BusinessUsers.EnvironmentBusinessToolsPolicy,Sitecore.Commerce.Plugin.BusinessUsers",
        "EnvironmentList": {
          "$type": "System.Collections.Generic.List`1[[System.String, mscorlib]], mscorlib",
          "$values": [
            "AdventureWorksShops",
            "AdventureWorksAuthoring",
            "HabitatAuthoring",
            "HabitatShops"
          ]
        }
      },
      {
        "$type": "Sitecore.Commerce.Plugin.SQL.EntityStoreSqlPolicy, Sitecore.Commerce.Plugin.SQL",
        "PolicyId": "Global",
        "AllowAdmin": true,
        "Database": "PlaceholderForGlobalDatabaseName",
        "EffectiveDate": "0001-01-01T00:`00:00`",
        "IsVisible": false,
        "Password": "PlaceholderForGlobalDatabasePassword",
        "Server": "PlaceholderForGlobalDatabaseServer",
        "TrustedConnection": false,
        "UserName": "PlaceholderForGlobalDatabaseUserName",
        "View": "EntityStoreSqlPolicy",
        "Version": "10.0.0",
        "AdditionalParameters": "",
        "ConnectTimeout": 20,
        "CommandTimeout": 180,
        "CleanEnvironmentCommandTimeout": 120000
      },
      {
        "$type": "Sitecore.Commerce.Core.DeploymentPolicy, Sitecore.Commerce.Core",
        "DeploymentId": "PlaceholderForDeploymentId",
        "DeploymentVersion": "1.0.0",
        "ParentNodeId": "Hub01"
      },
      {
        "$type": "Sitecore.Commerce.Core.ControllerMethodRolesPolicy, Sitecore.Commerce.Core",
        "ControllerMethodRegularExpression": "/commerceops/",
        "AuthorizedRoles": [
          "sitecore\\Commerce Business User",
          "commerce\\runtime"
        ]
      },
      {
        "$type": "Sitecore.Commerce.Core.ControllerMethodRolesPolicy, Sitecore.Commerce.Core",
        "ControllerMethodRegularExpression": "/api/",
        "AuthorizedRoles": [
          "sitecore\\Commerce Business User",
          "commerce\\runtime"
        ]
      },
      {
        "$type": "Sitecore.Commerce.Plugin.Management.SitecoreConnectionPolicy, Sitecore.Commerce.Plugin.Management",
        "Host": "PlaceholderForSitecoreHost",
        "SitecoreDatabase": "PlaceholderForSitecoreDatabase",
        "UserName": "PlaceholderForSitecoreUsername",
        "Domain": "PlaceholderForSitecoreDomain",
        "Password": "PlaceholderForSitecorePassword",
        "ConnectionLeaseTimeout": 60000,
        "AuthRequestUrl": "sitecore/api/ssc/auth/login"
        "Protocol": "https",
        "AllowAnonymousUser": "false"
      },
      {
        "$type": "Sitecore.Commerce.Plugin.Content.DefaultContentPathsPolicy, Sitecore.Commerce.Plugin.Content",
        "ContentPaths": {
          "$type": "System.Collections.Generic.List`1[[System.String, mscorlib]], mscorlib",
          "$values": [
            "/sitecore/Commerce/Commerce Control Panel"
          ]
        }
      },
      {
        "$type": "Sitecore.Commerce.Plugin.SQL.EntityShardingPolicy, Sitecore.Commerce.Plugin.SQL",
        "Expressions": {
          "$type": "System.Collections.Generic.List`1[[System.String, mscorlib]], mscorlib",
          "$values": [
            "Entity-Content.*?$",
            "Content-.*?$",
            "ContentItem-.*?$",
            "ContentPath-.*?$"
          ]
        },
        "TableName": "ContentEntities"
      },
      {
        "$type": "Sitecore.Commerce.Plugin.SQL.ListShardingPolicy, Sitecore.Commerce.Plugin.SQL",
        "Expressions": {
          "$type": "System.Collections.Generic.List`1[[System.String, mscorlib]], mscorlib",
          "$values": [
            "^List-ContentPath.*?$",
            "^List-ContentItem.*?$",
            "Entity-Content.*?$",
            "ContentItem-.*?$",
            "ContentPath-.*?$"
          ]
        },
        "TableName": "ContentLists"
      }
    ]
  }
}

Global environment configuration policies and parameters

The Global.json file is composed of multiple sections, each defining related policy properties.

ManagementCachePolicy properties

The ManagementCachePolicy policy controls the caching of item model objects from the Commerce Control Panel (in Sitecore Content Editor).

The following table describes the properties of the ManagementCachePolicy policy:

PropertyDescriptionDefault value
CurrencySetsCacheNameName of the cache where currency sets are stored.CurrencySets
FulfillmentCacheNameName of the cache where fulfillment options and types are stored.Fulfillment
PaymentsCacheNameName of the cache where payment options and payment types information is stored.Payments
CountriesCacheNameName of the cache where countries and regions are stored.Countries
ItemsCollectionCacheNameName of the cache where content item collections are stored.ItemsCollection
ItemsCacheNameName of the cache where items are stored.Items
ExpirationThe length of time after which a cache entry expires, in milliseconds.86400000
AllowCachingEnables or disables caching for the entity.true

EnvironmentBusinessToolsPolicy properties

The EnvironmentBusinessToolsPolicy policy lists the environments that are accessible from the Business Tools. Typically, this policy is defined on the instance of the Commerce Engine that is running the Authoring service.

The following table describes properties of the EnvironmentBusinessToolsPolicy policy:

PropertyDescriptionDefault value
EnvironmentListLists the environments that business users can access when using the Sitecore Experience Commerce Business Tools.
  • AdventureWorksShops
  • AdventureWorksAuthoring
  • HabitatAuthoring
  • HabitatShops

EntityStoreSqlPolicy properties

The EntityStoreSqlPolicy policy defines global database configuration. The following table describes properties of the EntityStoreSqlPolicy policy:

PropertyDescriptionDefault value
PolicyIdName of the policy that governs global database configuration.Global
AllowAdminAllows a range of database administration commands.true
DatabaseName of database that defines the global environment.No default.

The value is specified during deployment.
EffectiveDateDate that the database becomes effective.001-01-01T00:00:00
PasswordGlobal environment database password.No default.

The value is specified during deployment.
ServerGlobal environment database server.No default.

The value is specified during deployment.
TrustedConnectionDetermines whether or not to use a trusted connection.false
UserNameUser name for the global environment database.No default.

The value is specified during deployment.
VersionRunning version of the Sitecore XC.10.*.*
AdditionalParametersAllows to define additional parameter.No value defined.

Optional parameter.
ConnectTimeoutTime to wait connection to open, in seconds.20
CommandTimeoutTime to wait command to complete, in seconds.180
CleanEnvironmentCommandTimeoutTime to wait for a CleanEnvironmentRequest (in Postman) to complete, in seconds.120000

DeploymentPolicy properties

The following table describes properties of the DeploymentPolicy policy.

PropertyDescriptionDefault value
DeploymentIdUnique ID that identifies a deployment.No default.

The value is specified during deployment.
DeploymentVersionIdentifies the version of the deployment.1.0.0
ParentNodeIdIdentity of the parent node.Hub01

ControllerMethodRolesPolicy properties

The ControllerMethodRolesPolicy controls access to the Commerce Engine APIs. For example, it is used to determine which user can execute which operations.

The Global.json file defines two instances of the ControllerMethodRolesPolicy policy, one for CommerceOps, and one for the Commerce Engine API.

The following table describes properties for the instance of the ControllerMethodRolesPolicy policy that defines the Commerce API:

PropertyDefault value
ControllerMethodRegularExpression/api/
AuthorizedRolessitecore\\Commerce Business User

commerce\\runtime

The following table describes properties for the instance of the ControllerMethodRolesPolicy policy that defines the Commerceops route:

PropertyDefault value
ControllerMethodRegularExpression/Commerceops/
AuthorizedRolessitecore\\Commerce Business User

commerce\\runtime

SitecoreConnectionPolicy properties

The SitecoreConnectionPolicy contains properties that define the connection to the Sitecore host.

The following table describes properties of the SitecoreConnectionPolicy policy:

PropertyDescriptionDefault value
HostThe name of the Sitecore host.No default.

The value is specified during deployment.
SitecoreDatabaseThe name of the Sitecore master database.No default.

The value is specified during deployment.
UserNameThe user name required to connect to the Sitecore host.No default.

The value is specified during deployment.
DomainDomain of the Sitecore host.No default.

The value is specified during deployment.
PasswordUser password for authentication.No default.

The value is specified during deployment.
ConnectionLeaseTimeoutNumber of milliseconds after which an active connection to the Sitecore host is closed.60000
AuthRequestUrlThe URL for the authorization request.sitecore/api/ssc/auth/login
ProtocolThe protocol used to communicate with the host.https
AllowAnonymousUserDetermines whether or not authentication is required to connect to the host.false

DefaultContentPathsPolicy properties

The DefaultContentPathsPolicy contains properties that defines the path to the Sitecore Commerce Control Panel.

The following table describes properties of the DefaultContentPathsPolicy policy:

PropertyDescriptionDefault value
ContentPathsPath to the Commerce Control Panel in Sitecore./sitecore/Commerce/Commerce Control Panel

EntityShardingPolicy policies

The EntityShardingPolicy contains properties that defines database shard names for ContentEntities .

PropertyDescriptionDefault value
ExpressionsRegular expressions used for ContentEntities table names."Entity-Content.*?$"

"Content-.*?$"

"ContentItem-.*?$"

"ContentPath-.*?$"

ListShardingPolicy properties

The DefaultContentPathsPolicy contains properties that defines database shard names for ContentLists list.

PropertyDescriptionDefault value
ExpressionsRegular expressions used for ContentLists database table names."^List-ContentPath.*?$"

"^List-ContentItem.*?$"

"Entity-Content.*?

"ContentItem-.*?$"

"ContentPath-.*?$"
If you have suggestions for improving this article, let us know!