---
title: "Commerce Engineの設定ファイル"
slug: "commerce-engine-configuration-file"
abstract: "設定JSONファイルで利用可能なCommerce Engineプロパティを一覧および記述します。"
---
# Commerce Engineの設定ファイル

Commerce展開におけるCommerce Engine(CE)役割の各インスタンスは、サービスアプリケーション構成を高レベルで定義する独自のconfig.jsonファイルを持っています。

CE config.jsonファイルはCommerce Engineアプリケーションのルートにある*wwwroot*フォルダに位置しています。例えば、C:\\inetpub\\wwwroot\\CommerceShops\_Sc/wwwroot。

> !注config.jsonファイルに変更を加える場合は、[Commerce Engine config.jsonのベストプラクティス](https://doc.sitecore.com/xp/ja/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")を必ず守ってください。

このトピックでは、config.jsonファイルの各セクションで利用可能なCommerce Engineの設定設定を一覧かつ説明し、Sitecore.Commerce.Engine.SDK.zipファイルに含まれるサンプルのCommerce Engineソリューションに基づく例を提供します。

-   アプリケーション設定(AppSettings)
-   Azure Application Insights settings
-   ログ設定
-   Serilog 設定
-   キャッシュ設定
-   圧縮設定
-   Commerce Connectorの設定
-   ヘルスチェック設定

> !注プレースホルダーをデフォルト値として使用するパラメータ(例: "PlaceholderForSiteTitle" )は [、環境変数ファイル](https://doc.sitecore.com/xp/ja/developers/101/sitecore-experience-commerce/configuring-the-commerce-engine-using-environment-variables.html "Configuring the Commerce Engine using environment variables")を使って設定できます。

## AppSettings

Commerce Engine config.jsonファイルのAppSettingsセクションには、アプリケーション起動時に使われるパラメータなどのアプリケーションレベルの設定が含まれています。

以下は "AppSettings" セクションの例を示しています。

{
 "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,
 },

### アプリケーション設定の説明

以下の表は、AppSettingsセクションで利用可能な構成パラメータを説明します。

パラメータ

概要

"SiteTitle"

IIS Managerに表示されているウェブサイトの名前。  
  
デフォルト: "PlaceholderForSiteTitle"

"BootStrapFile"

アプリケーション起動時に読み込まれるグローバル環境構成を含むJSONファイル名。デフォルトでは、これが Global.json ファイルです。  
  
デフォルト: Global

"DeploymentId"

Microsoft Azure展開時に自動的に割り当てられる番号(GUID)です。  
  
デフォルト: "PlaceholderForDeploymentId"

"EnvironmentName"

アプリケーションスタートアップから始まるCommerce環境の名前です。  
  
デフォルト: "PlaceholderForEnvironmentName"

"EncryptionProtectionType"

暗号化鍵に使われるストレージの種類。  
  
デフォルト:分散アプリケーション向けに "Redis" キャッシュキーはRedisキャッシュに保存されます  
  
可能な値は、 "DPAPI-SID"、 "DPAPI-CERT"、 "LOCAL"、 "MACHINE"です。

"EncryptionCertificateHash"

PXFファイルの有効な証明書のサムプリントは、 "EncryptionProtectionType": "DPAPI-CERT"を使用している場合に示されています。

"EncryptionSID"

ドメイン登録ユーザーに対して有効なSIDを使用時の情報 "DPAPI-CERT""EncryptionProtectionType": DPAPI-SID

"EncryptionKeyStorageLocation"

暗号化鍵を保存する場所への経路 "EncryptionProtectionType": "MACHINE"。  
  
デフォルト: "c:\\\\Encryption-Keys\\\\" ?

"SitecoreIdentityServerUrl"

Sitecore IdentityサーバーのURLです。  
  
デフォルト: "PlaceholderForSitecoreIdentityServerUrl"

"AllowedOrigins"

クロスオリジンコールを行うために許可されるべきURLのリスト、例えばBusiness ToolsのURLやストアフロントURL。  
  
デフォルト: "PlaceholderForBizFxUrl|PlaceholderForSxaStorefrontUrl"

"AntiForgeryEnabled"

偽造防止を有効にするかどうか(ブール数)  
  
デフォルト: "PlaceholderForAntiForgeryEnabled"

"CommerceServicesHostPostfix"

Postfixは [Commerceサービスのホスト名](https://doc.sitecore.com/xp/ja/developers/101/sitecore-experience-commerce/commerce-hostnames.html)として付録されるルートドメイン名(2レベル)として使われます。  
  
デフォルト: "PlaceholderForCommerceServicesHostPostfix"

"UseHttpsInKestrel"

ASP.NETコアプロジェクトテンプレートにデフォルトで含まれているKestrelのWebサーバーでHttpsを使うかどうか(ブール数です)。  
  
デフォルト: "false"  
  
\> \[!注\]  
\> この設定は開発環境で使用されます。

## Azure Application Insights

Commerce Engine config.jsonファイルのApplication Insightsセクション("ApplicationInsights")では、Commerce Engineのパフォーマンス監視やテレメトリのための計測キーを設定できます。

"ApplicationInsights": {
 "InstrumentationKey": "",
 },

### Azure Application Insights parameter description

以下の表は "ApplicationInsights" セクションのパラメータを説明しています。

パラメータ

概要

"InstrumentationKey"

Microsoft Azureリソースで動作するCommerce Engineを監視するために生成されたAzure Application Insightsインスツルメンテーションキー。  
  
デフォルト: *デフォルトなし*

## 伐採

Commerce Engine config.jsonのLoggingセクションには [、アプリケーションログレベル](https://docs.microsoft.com/en-us/aspnet/core/fundamentals/logging/?view=aspnetcore-3.1)を制御できるパラメータや、診断目的でCommerce Engine上で [パイプライントレースログ](https://doc.sitecore.com/xp/ja/developers/101/sitecore-experience-commerce/pipeline-tracing.html "Pipeline tracing") を管理できるパラメータが含まれています。

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

### ログパラメータの説明

以下の表は「ロギング」セクションのパラメータを示しています:

パラメータ

概要

"IncludeScopes"

スコープの使用が必須かどうか。  
  
デフォルト: false

以下の各カテゴリーで捕獲すべき "LogLevel" の厳しさ:

"Default"

デフォルトログカテゴリのログレベル:  
  
デフォルト: "Warning"

"System"

システムログカテゴリのログレベルからキャプチャまで。  
  
デフォルト: "Warning"

"Microsoft"

Microsoftログカテゴリのキャプチャレベル  
  
デフォルト: "Warning"

"PipelineTraceLoggingEnabled"

[パイプライントレーシング](https://doc.sitecore.com/xp/ja/developers/101/sitecore-experience-commerce/pipeline-tracing.html)が有効かどうか。  
  
デフォルト: false

"SerilogLoggingEnabled"

Serilogログが有効かどうか。  
  
デフォルト: true

## セリログ

Serilogのセクションには、ログレベルを設定するために使えるSerilogログフレームワークの設定が含まれています。

"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 Wiki](https://github.com/serilog/serilog/wiki/Configuration-Basics)は、前述のコードサンプルで使用されたSerilogの設定を説明しています。

## キャッシュ

Commerce Engine config.jsonファイルの"Caching"セクションには、Commerce Engineで使用されるキャッシュプロバイダーを指定する設定が含まれています。

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

### キャッシュパラメータの説明

以下の表はキャッシュパラメータを示しています:

パラメータ

概要

"Memory" キャッシュプロバイダーパラメータ:  
  
\> \[!注\]  
\> メモリキャッシュプロバイダーは開発環境のみに適しており、本番環境では使用してはなりません。Redisキャッシュプロバイダは本番環境でのデプロイに推奨されます。

"Enabled"

メモリキャッシュで使用するかを指定します。  
  
デフォルト: "false"。

"CacheStoreName"

メモリキャッシュ提供者が使用するキャッシュストアの名前です。  
  
デフォルト: "Commerce-Memory-Store"

"Redis" キャッシュプロバイダーパラメータ:

"Enabled"

メモリキャッシュで使用するかを指定します。  
  
デフォルト: "true"

"CacheStoreName"

Redisキャッシュストアの名前です。  
  
デフォルト: "Commerce-Redis-Store"

"Configuration"

以前はRedisに接続するための構成です。  
  
デフォルト: "PlaceholderForRedisConfiguration"

"InstanceName"

Redisインスタンス名。  
  
デフォルト: "PlaceholderForRedisInstanceName"

## 圧縮

"Compression"セクションには[応答圧縮](https://doc.sitecore.com/xp/ja/developers/101/sitecore-experience-commerce/api-response-compression.html "API response compression")を制御する構成パラメータが含まれています。以下は"Compression"セクションの例を示しています:

"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"
 }
 },

### 圧縮パラメータの説明

以下の表は圧縮パラメータを示しています:

パラメータ

概要

"Enabled"

圧縮を有効にするか無効かを制御します。  
  
デフォルト: true

"ResponseCompressionOptions":

"EnableForHttps"

安全な接続を通じて応答を圧縮します。  
  
デフォルト: true

"MimeTypes"

圧縮のためのMIMEタイプの集合を一覧にしています: "text/plain"、 "text/css"、 "application/javascript"、 "text/html"、 "application/xml"、 "text/xml"、 "application/json"、 "text/json"、 "application/wasm"

GzipCompressionProviderOptions:

"Level"

圧縮レベルを設定します。  
  
デフォルト: "Fastest"

## コマースコネクター

CommerceConnectorセクションには、Commerce Engine ConnectクライアントのIDを指定する"ClientId"パラメータが含まれています。デフォルトは以下の通りです:"PlaceHolderForCommerceEngineConnectClientId"。

"CommerceConnector": {
 "ClientId": "PlaceHolderForCommerceEngineConnectClientId"
}

## 健康診断

[ASP.NET Core](https://docs.microsoft.com/en-us/aspnet/core/host-and-deploy/health-checks?view=aspnetcore-3.1)に基づくHealthCheckサービスは、展開されたロールの健康状態の取得を可能にします。

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

### 健康チェックパラメータの説明

パラメータ

概要

"Enabled"

HealthCheckサービスが有効になっているかどうかを指定します。

"URL"

アプリケーションエンドポイントのURLです。