Stoxello Pulse — SQL Server Production Database Setup

These steps are for deploying Pulse.Api and Pulse.Web to an end-user production environment. You will deploy compiled binaries (DLLs) and configure SQL Server + appsettings.json.


1) Prerequisites

Required

  • Microsoft SQL Server (2019/2022 recommended) installed and running
  • SQL Server Management Studio (SSMS) installed (or sqlcmd)
  • .NET Runtime installed on the app server (matching your build target)
  • Your deployment folders contain:
    • pulse.Api.dll
    • pulse.Web.dll

Network / Firewall

  • Ensure the app server can reach SQL Server on TCP 1433 (or your custom port).
  • If SQL Server is on another machine, open inbound TCP 1433 on the SQL server firewall.

Windows test (from app server):

Test-NetConnection -ComputerName YOUR_SQL_SERVER -Port 1433

2) Create Databases + SQL Login (SSMS)

Recommended: Use two databases

  • Pulse (main app database for Pulse.Api)
  • PulseAuth (authentication database for Pulse.Web)

Open SSMS → connect as a sysadmin → open a new query window → run:

-- Create databases
CREATE DATABASE [Pulse];
GO
CREATE DATABASE [PulseAuth];
GO

-- Create SQL Login (runtime + migrations; you can split later if desired)
CREATE LOGIN [pulse_app] WITH PASSWORD = 'REPLACE_WITH_STRONG_PASSWORD';
GO

-- Map login to Pulse DB
USE [Pulse];
GO
CREATE USER [pulse_app] FOR LOGIN [pulse_app];
GO
ALTER ROLE db_owner ADD MEMBER [pulse_app];
GO

-- Map login to PulseAuth DB
USE [PulseAuth];
GO
CREATE USER [pulse_app] FOR LOGIN [pulse_app];
GO
ALTER ROLE db_owner ADD MEMBER [pulse_app];
GO

✅ At this point both databases exist and the login can create/modify schema during install.


3) Update appsettings.json (Both API and Web)

You must update both config files on the deployed server:

  • pulse.Api/appsettings.json
  • pulse.Web/appsettings.json

3.1 Pulse.Api (Main DB)

Open:

pulse.Api/appsettings.json

Set the provider to mssql and set the SQL Server connection string:

{
  "Database": {
    "Provider": "mssql"
  },
  "ConnectionStrings": {
    "PulseDb": "",
    "PulseDbMySql": "",
    "PulseDbSqlServer": "Server=YOUR_SQL_SERVER;Database=Pulse;User Id=pulse_app;Password=STRONG_PASSWORD;Encrypt=True;TrustServerCertificate=True;"
  }
}

3.2 Pulse.Web (Auth DB)

Open:

pulse.Web/appsettings.json

Use the PulseAuth database:

{
  "Database": {
    "Provider": "mssql"
  },
  "ConnectionStrings": {
    "PulseDb": "",
    "PulseDbMySql": "",
    "PulseDbSqlServer": "Server=YOUR_SQL_SERVER;Database=PulseAuth;User Id=pulse_app;Password=STRONG_PASSWORD;Encrypt=True;TrustServerCertificate=True;"
  }
}

Connection String Notes (SQL Server)

SQL Server on same machine

  • Server=localhost

Named instance

  • Server=SERVERNAME\\SQLEXPRESS

Remote SQL Server

  • Server=192.168.1.50 (or DNS name)

Recommended security

  • Encrypt=True
  • TrustServerCertificate=True is OK for internal/self-signed; for full production cert validation, remove it and use a trusted cert.

4) Apply the Database Schema (Migrations)

Run migrations from the deployed binaries (no source required).

4.1 Run Pulse.Api migrations (Main DB)

From the folder containing pulse.Api.dll:

dotnet pulse.Api.dll --migrate --db-provider=mssql

4.2 Run Pulse.Web migrations (Auth DB)

From the folder containing pulse.Web.dll:

dotnet pulse.Web.dll --migrate-auth --db-provider=mssql

5) Verify Tables Were Created

In SSMS:

Pulse DB

USE [Pulse];
GO
SELECT COUNT(*) AS TableCount FROM sys.tables;
GO

PulseAuth DB

USE [PulseAuth];
GO
SELECT COUNT(*) AS TableCount FROM sys.tables;
GO

If TableCount is greater than 0 for both, schema deployment succeeded.


6) Start the Applications

Start your services (Windows Service / IIS / systemd / scheduled task—whatever your deployment uses).

A basic runtime check is to confirm:

  • API starts without DB errors
  • Web starts without DB errors
  • Login page loads (Web)
  • API endpoints return healthy status (if available)


Copy/Paste Quick Reference

dotnet pulse.Api.dll --migrate --db-provider=mssql
dotnet pulse.Web.dll --migrate-auth --db-provider=mssql