---
title: "Commerce Engine configuration file"
slug: "commerce-engine-configuration-file"
abstract: "Lists and describes the Commerce Engine properties available in the configuration JSON file."
---
# Commerce Engine configuration file

Each instance of a Commerce Engine (CE) role in a Commerce deployment has its own `config.json` file that defines the service application configuration at a high level.

The CE `config.json` file is located at the root of the Commerce Engine application, in the *wwwroot* folder, for example: `C:\inetpub\wwwroot\CommerceShops_Sc/wwwroot`.

> [!note]
> If you make changes to the `config.json` file, make sure you follow the [best practices for working with the Commerce Engine config.json](https://doc.sitecore.com/xp/en/developers/101/sitecore-experience-commerce/best-practices-for-working-with-the-commerce-engine-config-json-file.html "Best practices for working with the Commerce Engine config.json file").

This topic lists and describes Commerce Engine configuration settings available in each section of the `config.json` file, and provides examples based on the sample Commerce Engine solution included in the `Sitecore.Commerce.Engine.SDK.zip` file:

- Applications Settings (AppSettings)
- Azure Application Insights settings
- Logging settings
- Serilog settings
- Caching settings
- Compression settings
- Commerce Connector settings
- Health Check settings

> [!note]
> Parameters that use a placeholder as default value (for example, `"PlaceholderForSiteTitle"` ) can be set using an [environment variable file](https://doc.sitecore.com/xp/en/developers/101/sitecore-experience-commerce/configuring-the-commerce-engine-using-environment-variables.html "Configuring the Commerce Engine using environment variables").

<details>
<summary><h2>AppSettings</h2></summary>

The AppSettings section of the Commerce Engine `config.json` file contains application level settings, for example, parameters used at application startup time.

The following shows an example of the `"AppSettings"` section:

```csharp
{
  "AppSettings": {
    "SiteTitle": "PlaceholderForSiteTitle",
    "BootStrapFile": "Global",
    "DeploymentId": "PlaceholderForDeploymentId",
    "EnvironmentName": "PlaceholderForEnvironmentName",
    "EncryptionProtectionType": "Redis",
    "EncryptionCertificateHash": "Enter a valid certificate thumbprint for a PXF file. X-509 not supported yet",
    "EncryptionSID": "Enter a valid SID for a domain registered user",
    "EncryptionKeyStorageLocation": "c:\\Encryption-Keys\\",
    "SitecoreIdentityServerUrl": "PlaceholderForSitecoreIdentityServerUrl",
    "AllowedOrigins": "PlaceholderForBizFxUrl|PlaceholderForSxaStorefrontUrl",
    "AntiForgeryEnabled": "PlaceholderForAntiForgeryEnabled",
    "CommerceServicesHostPostfix": "PlaceholderForCommerceServicesHostPostfix",
    "UseHttpsInKestrel": false,
  },

```

### Application settings description

The following table describes the configuration parameters available in the `AppSettings` section.

| Parameter | Description |
| --- | --- |
| `"SiteTitle"` | The name of the website as displayed in IIS Manager.<br><br>Default: `"PlaceholderForSiteTitle"` |
| `"BootStrapFile"` | The name of the JSON file that contains the global environment configuration that is loaded at application startup. By default, this is the `Global.json` file.<br><br>Default: `Global` |
| `"DeploymentId"` | The number (GUID) automatically assigned in Microsoft Azure deployment.<br><br>Default: `"PlaceholderForDeploymentId"` |
| `"EnvironmentName"` | The name of the Commerce environment to start at application startup.<br><br>Default: `"PlaceholderForEnvironmentName"` |
| `"EncryptionProtectionType"` | Type of of storage used for encryption keys.<br><br>Default: `"Redis"` Cache keys are stored in the Redis cache for distributed applications<br><br>Possible values are: `"DPAPI-SID"`, `"DPAPI-CERT"`, `"LOCAL"`, `"MACHINE"`. |
| `"EncryptionCertificateHash"` | A valid certificate thumbprint for a PXF file when using `"EncryptionProtectionType": "DPAPI-CERT"`. |
| `"EncryptionSID"` | A valid SID for a domain registered user when using `"DPAPI-CERT""EncryptionProtectionType": DPAPI-SID` |
| `"EncryptionKeyStorageLocation"` | Path to the location where to store the encryption key when using `"EncryptionProtectionType": "MACHINE"`.<br><br>Default: `"c:\\Encryption-Keys\\"` ? |
| `"SitecoreIdentityServerUrl"` | The URL of the Sitecore Identity server.<br><br>Default: `"PlaceholderForSitecoreIdentityServerUrl"` |
| `"AllowedOrigins"` | List of URLs that should be allowed to make cross-origin calls, such as the Business Tools URL, and the storefront URL.<br><br>Default: `"PlaceholderForBizFxUrl\|PlaceholderForSxaStorefrontUrl"` |
| `"AntiForgeryEnabled"` | Whether to enable antiforgery (boolean).<br><br>Default: `"PlaceholderForAntiForgeryEnabled"` |
| `"CommerceServicesHostPostfix"` | Postfix used as the root domain name (two-levels) to append as the [hostname for Commerce services](https://doc.sitecore.com/xp/en/developers/101/sitecore-experience-commerce/commerce-hostnames.html).<br><br>Default: `"PlaceholderForCommerceServicesHostPostfix"` |
| `"UseHttpsInKestrel"` | Whether to use Https in the Kestrel Web server included by default in ASP.NET Core project templates (boolean).<br><br>Default: `"false"`<br><br>> [!note]<br>> This setting is used in a development environment. |

</details>

<details>
<summary><h2>Azure Application Insights</h2></summary>

The Application Insights section (`"ApplicationInsights"`) in the Commerce Engine `config.json` file allows you to configure the instrumentation key for Commerce Engine performance monitoring and telemetry.

```csharp
"ApplicationInsights": {
    "InstrumentationKey": "",
  },

```

### Azure Application Insights parameter description

The following table describes the parameter in the `"ApplicationInsights"` section.

| Parameter | Description |
| --- | --- |
| `"InstrumentationKey"` | The Azure Application Insights instrumentation key generated for monitoring the Commerce Engine running in a Microsoft Azure resource.<br><br>Default: *no default* |

</details>

<details>
<summary><h2>Logging</h2></summary>

The Logging section in the Commerce Engine `config.json` contains parameters that allow you to control [application log levels](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-3.1), and [pipeline trace logging](https://doc.sitecore.com/xp/en/developers/101/sitecore-experience-commerce/pipeline-tracing.html "Pipeline tracing") on the Commerce Engine for diagnostic purposes.

```csharp
{
  "Logging": {
    "IncludeScopes": false,
    "LogLevel": {
      "Default": "Warning",
      "System": "Warning",
      "Microsoft": "Warning"
      },
    "SerilogLoggingEnabled": true,
    "PipelineTraceLoggingEnabled": false
  }

```

### Logging parameters description

The following table describes the parameters in the Logging section:

| Parameter | Description |
| --- | --- |
| `"IncludeScopes"` | Whether it is required to use scopes.<br><br>Default: `false` |
| Severity of `"LogLevel"` to capture for each of the following category: |  |
| `"Default"` | Log level to capture for Default log category:<br><br>Default: `"Warning"` |
| `"System"` | Log level to capture for System log category.<br><br>Default: `"Warning"` |
| `"Microsoft" ` | Log level to capture for Microsoft log category<br><br>Default: `"Warning"` |
| `"PipelineTraceLoggingEnabled"` | Whether [pipeline tracing](https://doc.sitecore.com/xp/en/developers/101/sitecore-experience-commerce/pipeline-tracing.html) is enabled.<br><br>Default: `false` |
| `"SerilogLoggingEnabled"` | Whether Serilog logging is enabled.<br><br>Default: `true` |

</details>

<details>
<summary><h2>Serilog</h2></summary>

The Serilog section contains configuration settings from the Serilog logging framework that you can use to configure logging levels.

```csharp
"Serilog": {
    "Using": [
       "Serilog.Sinks.Literate",
       "Serilog.Sinks.File"],
       "Serilog.Sinks.ApplicationInsights"
       ]
    "MinimumLevel":  {
       "Default": "Warning",
       "Override": {
          "Microsoft": "Warning",
          "System": "Warning"
          }
    "WriteTo": [
       {
        "Name":  "ApplicationInsights",
        "Args":  {
            "restrictedToMinimumLevel":  "Warning",
            "telemetryConverter": "Serilog.Sinks.ApplicationInsights.Sinks.ApplicationInsights.TelemetryConverters.TraceTelemetryConverter, Serilog.Sinks.ApplicationInsights"
            }
         },
    "FileSizeLimitBytes": 100000000
  },

```

### Serilog parameters description

The [Serilog Wiki](https://github.com/serilog/serilog/wiki/Configuration-Basics) describes Serilog configuration settings used in the preceding code sample.

</details>

<details>
<summary><h2>Caching</h2></summary>

The `"Caching"` section in the Commerce Engine `config.json` file contains settings that specifies the cache provider used by the Commerce Engine.

```csharp
"Caching":  {
   "Memory":  {
      "Enabled":  false,
      "CacheStoreName":  "Commerce-Memory-Store"
      },
   "Redis":  {
      "Enabled":  true,
      "CacheStoreName":  "Commerce-Redis-Store",
      "Options":  {
          "Configuration":  "PlaceholderForRedisConfiguration",
          "InstanceName":  "PlaceholderForRedisInstanceName"
          }
      }
 },

```

### Caching parameters description

The following table describes caching parameters:

| Parameter | Description |
| --- | --- |
| `"Memory"` cache provider parameters:<br><br>> [!note]<br>> The memory cache provider is suitable for development environment only, and must not be used for production. The Redis cache provider is recommended for a production deployment. |  |
| `"Enabled"` | Specifies whether to use in memory caching.<br><br>Default: `"false"`. |
| `"CacheStoreName"` | The name of the cache store used by the memory cache provider.<br><br>Default: `"Commerce-Memory-Store"` |
| `"Redis"` cache provider parameters: |  |
| `"Enabled"` | Specifies whether to use in memory caching.<br><br>Default: `"true"` |
| `"CacheStoreName"` | The name of Redis cache store.<br><br>Default: `"Commerce-Redis-Store"` |
| `"Configuration"` | The configuration used to connect to Redis.<br><br>Default: `"PlaceholderForRedisConfiguration"` |
| `"InstanceName"` | The Redis instance name.<br><br>Default: `"PlaceholderForRedisInstanceName"` |

</details>

<details>
<summary><h2>Compression</h2></summary>

The `"Compression"` section contains configuration parameters that control [response compression](https://doc.sitecore.com/xp/en/developers/101/sitecore-experience-commerce/api-response-compression.html "API response compression"). The following shows an example of the `"Compression"` section:

```csharp
"Compression": {
   "Enabled": true,
   "ResponseCompressionOptions": {
      "EnableForHttps": true,
      "MimeTypes": [
        "text/plain",
        "text/css",
        "application/javascript",
        "text/html",
        "application/xml",
        "text/xml",
        "application/json",
        "text/json",
        "application/wasm"
      ]
   },
   "GzipCompressionProviderOptions": {
      "Level": "Fastest"
      }
   },

```

### Compression parameters description

The following table describes compression parameters:

| Parameter | Description |
| --- | --- |
| `"Enabled"` | Controls whether compression is enabled or disabled.<br><br>Default: `true` |
| `"ResponseCompressionOptions":` |  |
| `"EnableForHttps"` | Compresses responses over secure connections.<br><br>Default: `true` |
| `"MimeTypes"` | Lists the set of MIME types for compression: `"text/plain"`, `"text/css"`, `"application/javascript"`, `"text/html"`, `"application/xml"`, `"text/xml"`, `"application/json"`, `"text/json"`, `"application/wasm"` |
| `GzipCompressionProviderOptions`: |  |
| `"Level"` | Sets the compression level.<br><br>Default: `"Fastest"` |

</details>

<details>
<summary><h2>Commerce Connector</h2></summary>

The `CommerceConnector` section contains the `"ClientId"` parameter that specifies the ID of the Commerce Engine Connect client. The default is: `"PlaceHolderForCommerceEngineConnectClientId"`.

```csharp
"CommerceConnector": {
  "ClientId": "PlaceHolderForCommerceEngineConnectClientId"
}

```

</details>

<details>
<summary><h2>Health check</h2></summary>

The `HealthCheck` service, based on the [ASP.NET Core](https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/health-checks?view=aspnetcore-3.1), allows the retrieval of health status of a deployed role.

```csharp
"HealthCheck":  {
    "Enabled":  true,
    "URL":  "/health"
   }

```

### Health check parameters description

| Parameter | Description |
| --- | --- |
| `"Enabled"` | Specifies whether the HealthCheck service is enabled. |
| `"URL"` | The URL of the application endpoint. |

</details>