Skip to content

Environment Variables

All credentials and configuration options are managed through environment variables. Never hardcode credentials in source code.

VariableDescriptionExample
MSSQL_SERVERSQL Server hostname or IPprod-server.database.windows.net
MSSQL_DATABASEDatabase nameProductionDB
MSSQL_USERSQL Server usernameapp_user
MSSQL_PASSWORDSQL Server password(secret)
VariableDefaultDescription
MSSQL_PORT1433SQL Server port
DEVELOPER_MODEfalsetrue for development (relaxed TLS, detailed errors)
MSSQL_READ_ONLYfalseBlocks write operations
MSSQL_WHITELIST_TABLES(empty)Tables allowed for modification in read-only mode
MSSQL_AUTHsqlAuthentication mode: sql, integrated, azure
MSSQL_ENCRYPT(auto)TLS encryption control. Only effective with DEVELOPER_MODE=true. false = disable encryption (required for SQL Server 2008/2012). If not set: false in dev, always true in production
MSSQL_CONNECTION_STRING(empty)Custom connection string (overrides other variables)
Ventana de terminal
# Copy and edit
cp .env.example .env
# Example content
MSSQL_SERVER=localhost
MSSQL_DATABASE=MyDB
MSSQL_USER=sa
MSSQL_PASSWORD=YourPassword123
MSSQL_PORT=1433
DEVELOPER_MODE=true
MSSQL_READ_ONLY=false

Linux/macOS:

Ventana de terminal
source .env

Windows PowerShell:

Ventana de terminal
Get-Content .env | ForEach-Object {
$name, $value = $_ -split '=', 2
[Environment]::SetEnvironmentVariable($name, $value)
}
Ventana de terminal
# Linux/macOS
chmod 600 .env
# Windows
icacls .env /inheritance:r /grant:r "%USERNAME%:R"