When you deploy the Commerce Engine, you perform the following tasks:
Compile the Commerce Engine
To compile the Commerce Engine:
- Install the Sitecore Commerce SDK by unzipping the
Sitecore.Commerce.SDK.1.x.xxxx.zip file, located at the
root of the Sitecore Commerce release package.
- Open a command prompt and run the restore command from the SDK root
Note: By default, the
dotnet.exe is installed under c:\Program
Files\dotnet if the path has not been added
- Run the publish command to create a build of the Sitecore Commerce Engine in a
local folder. For example:
dotnet publish .\Sitecore.Commerce.Engine -o c:\Deploy\Sitecore.Commerce
sure that the installed version of the .NET Framework is the DevPack/SDK
edition, not the Runtime edition. The dotnet publish
command will fail if only the Runtime edition is installed.
Create the Commerce Server databases
To create the SitecoreCommerce_Global and SitecoreCommerce_SharedEnvironments
- Open SQL Server Management Studio.
- Run the CommerceServicesDbScript.sql script (located in the
Sitecore SDK directory).
Install the Commerce Engine service
To install the Commerce Server Engine service:
- Open IIS Manager.
- Create a new Application Pool called CommerceAuthoring and set the
- Select No Managed Code for the .NET CLR
Version of the App Pool.
- Select Integrated for Managed
- Set the Identity to use the same CSFndRuntimeUser
that you used for Commerce Server as the identity.
- Create a new IIS Site called CommerceAuthoring:
- Keep the default binding settings with the exception of the port,
which is set to 5000.
- Set the Application Pool to the application pool you created
in step 2.
- Create a new folder in C:\inetpub called
CommerceAuthoring and set the Physical
Path to this new folder.
- Copy the contents of the c:\Deploy\Sitecore.Commerce folder
(created when you compiled the Commerce Server Engine) to the new physical
directory you created in step 3.
- Verify that you can retrieve metadata from the Commerce Engine service via
the following URL: http://localhost:5000/api/$metadata.
Configure web payment functionality for the site
Create a Braintree sandbox account to incorporate web payment functionality into your
To create a Braintree sandbox account:
- Go to https://www.braintreepayments.com/sandbox.
- Enter the required information in the Sign up for the
sandbox pane, and click Try the sandbox.
- Follow the instructions to activate and log in to your Braintree sandbox
- Get the MerchantID, Public Key and
Private Key information from the Braintree sandbox
- Use the information from step 4 to fill in the corresponding section inside the
PlugIn.Habitat.CommerceAuthoring-1.0.0.json file under the
wwwroot\data\Environments folder (in the IIS site folder you created when you
installed the Commerce Engine service).
- Search for "$type":
Plugin.Sample.Payments.Braintree" inside the
- Make sure the key values are contained by quotation marks. For
Bootstrap and initialize the Commerce Server environment
The Bootstrap process loads the environments from the data/environments directory in
the physical location of the IIS service to the Commerce Engine service.
The Habitat catalogs and inventory (located under
wwwroot\data\Catalogs) are imported during the bootstrap
process. You can verify that all catalogs and inventory are imported through the
Catalog Manager. If they are not present, you must import them manually.
Make sure that the application pool identity for the Commerce Authoring site
((.\CSFndRuntimeUser)) has the proper permissions for the
Catalog web service in the Windows Authorization Manager.
Before you perform the following steps, review the Default Commerce Engine service settings
you have not configured the environment .json files correctly, the process may
- Open a browser and run http://localhost:5000/commerceops/Bootstrap(). The URL is
When the Bootstrap process finishes, you can view
new rows inside the "CommerceEntities" and "CommerceLists" tables of
the SitecoreCommerce_Global database.
If the Bootstrap
process does not finish as expected, check the
CommerceAuthoring\wwwroot\logs for possible
- Run the Initialize Environment process to initialize the following
environments for the Commerce Authoring Service. Note that the following
URLs are case-sensitive; if you copy the URLs from this topic, make sure
there are no invisible formatting characters for the quotation marks.
- Open http://localhost:5000/commerceops/InitializeEnvironment(environment='AdventureWorksShops')
in a browser to initialize the Adventure Works environment.
- Openhttp://localhost:5000/commerceops/InitializeEnvironment(environment='HabitatAuthoring') in a browser to initialize
the Habitat Authoring environment.
When the initialization process finishes, you can view new rows
inside the "CommerceEntities" and "CommerceLists" tables of the
If the initialization process does not complete as expected,
check the CommerceAuthoring\wwwroot\logs
Note: If you need to run the initialization process
again, you must clear all rows in the "CommerceEntities" and
"CommerceLists" tables and restart the CommerceAuthoring site to
clear the cache.
- If you need to run the Minion services automatically for post-order
processing, make sure the EnvironmentName attribute in
the \CommerceAuthoring\wwwroot\config.json file is set
- Restart the CommerceAuthoring IIS service to complete activation.