Portal Community
The Golden Rule If a file contains your machine name, an IP address, a password, or a connection string pointing at live data — it does not get committed. Every other developer has a different machine. Every production server has different credentials.

Commit vs. Do Not Commit

FileCommit?Reason
appsettings.jsonYesBase defaults, machine-neutral
appsettings.Development.jsonYesDev feature flags, log levels
appsettings.Staging.jsonYesStaging non-secret settings
appsettings.Production.jsonYesProd non-secret settings (log levels, sampling)
appsettings.Tenant.{code}.jsonYesTenant feature flags, topic names, model selection
appsettings.Tenant.{code}.development.jsonYesShared dev DB (if team shares a dev DB)
launchSettings.jsonYesEnv var names and ports — no secrets
appsettings.Development.Local.jsonNeverYour machine's SQL Server name
appsettings.Staging.Local.jsonNeverMachine-local overrides
appsettings.Tenant.{code}.production.jsonNeverReal credentials and production addresses
appsettings.Tenant.{code}.staging.jsonNeverStaging credentials
Any file with a password or API keyNeverUse a vault; inject at deploy time

gitignore Rules

These patterns are already in .gitignore at the root of the repository:

appsettings.Local.json
appsettings.*.Local.json
**/appsettings.Local.json
**/appsettings.*.Local.json

For tenant production/staging files that should never be committed, add:

**/appsettings.Tenant.*.production.json
**/appsettings.Tenant.*.staging.json

Alternatively, manage tenant env files entirely outside the repository — deploy them from a secrets manager rather than keeping them in the repo at all.

Onboarding a New Developer

1

Clone the repository

git clone https://github.com/bizfirstai/BizFirstPayrollV3.git
2

Create appsettings.Development.Local.json

In src/mvc-server/Solutions/AiUltimate/BizFirst.Ai.Consolidated.WebApi/, create the file with their machine's SQL Server name. Full template in Local Setup.

3

Verify launchSettings.json

Confirm ASPNETCORE_ENVIRONMENT=Development and TENANT_CODE is set to the tenant they are working on.

4

Run the app

Press F5 or dotnet run. The app connects to their local SQL instance.

5

Confirm git will not stage the Local file

git status

appsettings.Development.Local.json must not appear. If it does, check .gitignore.

Keeping appsettings.json Neutral

The base file must use placeholder connection strings that are safe to commit. The placeholder .\SQLEXPRESS is acceptable — it either works on developer machines that happen to have a default SQLEXPRESS instance, or it gets overridden by each developer's Local file.

Reject in code review If a PR changes appsettings.json to contain a specific machine name like LAPTOP-XYZ\SQLEXPRESS or a network address like sql.apexretail.local, reject it and ask the author to move the value to their Local file.

CI/CD Pipeline Practices

PracticeHow
Set environmentASPNETCORE_ENVIRONMENT as a secure pipeline variable
Set tenantTENANT_CODE as a secure pipeline variable
Deploy tenant credentialsFetch from Azure Key Vault / AWS Secrets Manager → write appsettings.Tenant.{code}.production.json at deploy time
Never store secrets in the repoEven in branches or tags — secrets in git history are permanent leaks

Code Review Checklist

Secrets Policy

SecretWhere to store
JWT signing keyVault; injected at deploy time into Tenant.{code}.production.json
Database passwordsVault
Kafka credentialsVault
OpenAI / LLM API keysVault
Google SSO client secretVault
Grafana API keyVault
Secrets on developer machinesappsettings.Development.Local.json — gitignored, never leaves the machine