---
title: Deploy a new Commerce Connect site
slug: dxp/docs/creating-a-new-commerce-site-and-deploying
docTags: 
createdAt: 2026-07-30T20:33:08.367Z
---

:::hint{type="info"}
**When is this applicable?**
This is an onboarding scenario for a **first-time deployment** when you want to set up a site and run development in a cloud environment from the beginning. Through Visual Studio you can deploy an empty database. A new site like this does not require database restore, and the database schema will be created during initial deployment.
:::

## Before you start

This topic uses Visual Studio with the Optimizely extensions and publish profiles. However, you can also use [other deployment methods](docId\:KiD2UHYvZbbOKUp6LQaM1).

- See [DXP requirements](docId\:EbFCNo6K0wQHK--V4b_tz) for recommended software versions, tools, and services when deploying.
- See [Get started with DXP](docId\:stNTOCwlyabMLz23pwQ7S) for deployment information.

## Deployment steps

This section describes how to create a website with an Optimizely Content Management System (CMS), Commerce Connect, and Azure and deploy the code and database with content to the Integration environment in DXP. The deployment is done from the deployment API using the publishing profiles provided with your DXP setup.

:::hint{type="warning"}
**Important**
A Commerce Connect solution consists of two databases: one for CMS and one for Commerce Connect. So, you need to repeat some deployment steps for each site.
:::

### Step 1 – Create Optimizely project

```powershell
dotnet new epi-commerce-empty
```

1. Go to **Tools > NuGet Package Manager > Manage NuGet Packages for Solution** to update the website to the latest Optimizely NuGet packages.
2. In the NuGet Package manager:
   1. Select **Updates**.
   2. Select **Optimizely Packages** in the **Package source** field to locate the latest updates.
   3. Enable **Select all packages**.
   4. Click **Update** and confirm the updates.

![Update NuGet packages](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/ofWnGwsOOO0R15_8B7_wE-20260722-203651.png "update-packages.png")

3. Add a cloud platform to the website. In the NuGet package manager:
   1. Select **Browse**.
   2. Enter **Optimizely Azure** in the search field.
   3. Select the `EPiServer.CloudPlatform.Commerce` package.
   4. Select your project.
   5. Click **Install** and confirm the installation.

![confirm the installation](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/OkuBhV8IQNdrWdRyUmNrb-20260722-203651.png "imagedh69s.png")

4. To configure the `EPiServer.CloudPlatform.Cms` package, you need to add this code in `ConfigureServices` method in `startup.cs` file.

:::hint{type="warning"}
**Important**
`AddCmsCloudPlatformSupport` is required for all DXP environments because it is needed for cache events and BLOB storage.
:::

```csharp
public class Startup 
{ 
    private readonly IWebHostEnvironment _webHostingEnvironment; 
    private readonly IConfiguration _configuration; 
 
    public Startup(IWebHostEnvironment webHostingEnvironment, IConfiguration configuration) { 
        _webHostingEnvironment = webHostingEnvironment; 
        _configuration = configuration; 
    } 
 
    public void ConfigureServices(IServiceCollection services){ 
       ... 
       services.AddCmsCloudPlatformSupport(_configuration); 
	  services.AddCommerceCloudPlatformSupport(_configuration); 
    } 
}
```

:::hint{type="info"}
**Note**
If you only want to add the `EPiServer.CloudPlatform.Cms` package to specific environments, you can run something similar to the following code to check the environment.
:::

```csharp
public class Startup 
{ 
    private readonly IWebHostEnvironment _webHostingEnvironment; 
    private readonly IConfiguration _configuration; 
 
    public Startup(IWebHostEnvironment webHostingEnvironment, IConfiguration configuration) { 
        _webHostingEnvironment = webHostingEnvironment; 
        _configuration = configuration; 
    } 
 
    public void ConfigureServices(IServiceCollection services){ 
       ...        
        if (!_webHostingEnvironment.IsDevelopment()) { 
           services.AddCmsCloudPlatformSupport(_configuration);				services.AddCommerceCloudPlatformSupport(_configuration); 
        } 
    } 
} 
```

5. Run the solution.

### Step 2 – Publish the website to create a code package

1. Right-click the project in Visual Studio's Solution Explorer and select **Publish**.
2. In the **Pick a publish target** dialog box, select **New Folder**.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/VeOb1IGGYBTfQyS5lMdLp-20260722-203652.png)

3. Click **Next**.
4. Choose a location or keep the default.

![](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/Uk7tT_j3K6KgdEdi5YE1P-20260722-203651.png)

5. Click **Finish**.
6. Zip the contents of the publish directory and rename to `ProjectName.cms.app.00001.nukpg`.

### Step 3 – Deploy the package

Get API credentials. See [Deployment API authentication](docId:2zbogiRaPvgO24HKMj_9e).The following sample uses PowerShell to deploy the code. Any deployment API method will work as long as you deploy a package.

```powershell
# Connect EpiCloud using credentials from portal
Connect-EpiCloud -ProjectId "projectId" -ClientKey "key" -ClientSecret "secret"

# Upload .NET Core Alloy to blob storage
$sasUrl = Get-EpiDeploymentPackageLocation
Add-EpiDeploymentPackage -SasUrl $sasUrl -Path .\AlloyNetCore.cms.app.0.1.0.nupkg

# Deploy package to environment. This will first build a docker image out of the package and then deploy it to the target environment.
Start-EpiDeployment -DeploymentPackage "AlloyNetCore.cms.app.0.1.0.nupkg" -TargetEnvironment "Integration" -DirectDeploy -Wait
```

### Step 4 – Verify the website

1. Go to the default access URLs for the environment, for example `http://\[projectNNNNinte\].dxcloud.episerver.net`.
2. Log in as an administrator to the website.
3. Verify that the website is working.

### Step 5 – Add Search & Navigation

An index is automatically set up and configured as part of DXP. In this step, you add Optimizely Search & Navigation (formerly Optimizely Find) as the default search for your solution and publish the changes to Integration.

1. In the NuGet package manager for your project, locate the `EPiServer.Find.Cms` package and click **Install**.

![locate the EPiServer.Find.Cms package and click Install](https://api.archbee.com/api/optimize/BrbvVORKJ5iIeSMZye5kI/E75rM6aRGDo9bPB2uPOYt-20260722-203651.png "add-find.png")

2. In Solution Explorer, right-click the project in Visual Studio and select **Publish**.

:::hint{type="warning"}
**Caution**
In the **Edit > Publish > Settings** screen, ensure that **Update database** is *not* selected (deselect if needed).
:::

3. Click **Publish**.
4. Verify that the website is working.
