API appsettings.json Configuration File

AzureAd Section

Section required for the Azure AD / Entra ID Implementation. For more on how to configure Azure AD / Azure Entra ID for application authentication, see the Configuring Azure PDF

Key Default Value Description
Instance https://login.microsoftonline.com/ Default specified by MSAL Documentation
Domain CUSTOM The named value of your Microsoft Azure Domain
TenantId CUSTOM The tenant ID on your Microsoft Azure Domain.
ClientId CUSTOM This field contains the client app ID assigned by the Azure App Registration process.
Scopes UserAccess Description
CallbackPath /signin-odc This value was put into place by a MSAL tutorial but is not used by the LymeTemplate application

Connection Strings Section

Key Default Value Description
DefaultConnection Data Source=.\\SQLEXPRESS;Integrated Security=True;Connect Timeout=5;TrustServerCertificate=True;Initial Catalog=YourDatabaseName The default connection string used for database / Entity Framework Connections

Logging Section

This section was put into place by default by the .NET WebApi template and won't be documented here.

ApiConfig Section

This configuration section contains values that pertain only to the API (and not the front-end application)

Key Default Value Description
environment Local The environment this API instance is running in. Should align exactly with the name of an environment listed in the AppConfig:Environments section
changeLogUrl URL The URL of the change log that supplies data to the Change Log feature
dataDirectory C:\WebApps\LymeTemplateApp The root data directory on the server's file system
errorHandling n/a This subsection of the config contains the values that control the delivery of automated error reports.
emailSettings n/a See below for a more detailed explanation
motdData C:\AppData\LymeTemplate\motd.json The Message of the Day data is stored on the file system because it's so frequently accessed
auditEnabled true Specifies whether CRUD values will be tracked in the ActivityLog database table for auditing purposes.
auditTables Address, Announcement, ConfigSetting, EmailTemplate, State, UserInfo A list of comma separated tables that will be stored for audit logging purposes.

EmailSettings Section

The email settings section control the behavior of emails being sent from the app. Most of the business logic pertaining to this section resides in the API's Code project in a file called ``EmailHelper.cs`.

Key Default Value Description
noReplyEmailAddress noreply@yourdomain.com The default address that will appear in the from field for automated emails from the app.
useSmtpPickup true Specifies whether to use the SMTP Pickup directory instead of an SMTP Server. The default value is true for local development.
enableSsl true Specifies whether to enable SSL for SMTP delivered emails.
smtpServer n/a Specifies the SMTP server to use when the useSmtpPickup option is not enabled.
port n/a The port for SMTP traffic to use
username n/a The username to use for SMTP authentication
password DefaultValue The password to use for SMTP authentication
smtpPickupDirectory C:\SmtpPickup The directory where the SMTP Pickup delivered message will be caught
emailBodyDataFolder Emails are logged to the database, but because of the usual large size of emails, the logged email body contents are stored in this directory

AppConfig Section

This configuration section contains values that apply to both the API and client application. This data is bootstrapped into the client application at app startup.

Key Default Value Description
appVersion 1.0.0.0 This value is automatically populated by the buildnumber.txt file in the root of the API's file system. This build number matches the TeamCity CI/CD build in non-local environments.
appName LymeTemplate App The name of the application
environment null This value is automatically populated with the environment that maps back to the apiSettings:environment app setting above.
environments See below A list of environment where the app is hosted.
updateRealTimeDataIntervalSeconds DefaultValue The number of seconds that should be used as the interval duration when polling the Real Time Data endpoint from the Angular frontend.
stripePublicKey DefaultValue The public key used for Stripe transactions.

Environments

Each environment has the following available setting:

Key Example Value Description
name Local The name of the environment. One of the environments in the environment list must match the name of the apiSettings:environment app setting above.
url http://localhost:4200/ The root URL for the client application. Trailing slash is required.
api http://localhost:5117/ The root URL for the API. Trailing slash is required.
bootstrapLabelCss danger The bootstrap color to use for the app environment label.
description This is the local instance The description of the environment,

Pre-configured Environments

Name Example API URL Description
Local http://localhost:4200 This is the configuration environment used by default for local development. This environment hosts the API on a Kestrel based web server.
Local (IIS) http://localhost/LymeStack/api/ This is the configuration used for local development using IIS as the hosting platform for the API. While there is more setup involved, this method is preferred for longer term API development.
UAT https://uat.lymestack.com/api/ This environment is for user acceptance testing of new features.
Staging https://staging.lymestack.com/api/ This environment is for testing deployments.
Key https://www.lymestack.com/app/ This is the live production environment.

Other Remaining Settings

Key Default Value Description
AllowedHosts * CORS Configuration Setting
Stripe:SecretKey n/a The key used for Stripe Credit Card transaction processing