Content API Appsettings
Below is the documentation for the appsettings.json
configuration file in Content.API
. This documentation explains each section of the file, guiding you to understand and manage the application settings effectively.
Overview
The appsettings.json
file specifies configuration settings for an ASP.NET Core application. It includes application-specific settings, such as connection strings, messaging services, scheduler jobs, Azure configurations, and other application settings.
1. ConnectionStrings
{
"ConnectionStrings": {
"DefaultConnection": "{Your connection string comes here}"
}
}
Docker-compose form of environment variables.
environment:
ConnectionStrings__DefaultConnection:"{Your connection string comes here}"
- DefaultConnection: This signifies the database connection string, which is used to connect to your database.
2. RabbitMQ
{
"RabbitMQ": {
"HostName": "{Your hostname comes here}",
"Username": "{Your username comes here}",
"Password": "{Your password comes here}",
"ExchangeType": "fanout",
"ExchangeName": "content_exchange"
}
}
Docker-compose form of environment variables.
environment:
RabbitMQ__HostName:"{Your hostname comes here}"
RabbitMQ__Username:"{Your username comes here}"
RabbitMQ__Password:"{Your password comes here}"
RabbitMQ__ExchangeType:"fanout"
RabbitMQ__ExchangeName:"content_exchange"
- HostName: The host name or IP address of the RabbitMQ service.
- Username: RabbitMQ username.
- Password: RabbitMQ password.
- ExchangeType: The exchange type for messaging; "fanout" is used here.
- ExchangeName: The name of the exchange to which messages will be sent.
3. SchedulerJob
{
"SchedulerJob": {
"WebhookDispatcherIntervalInMinute": 1,
"WebhookAlertMailDispatcherIntervalInMinute": 30,
"FailedWebhookAlertThreshold": 25
}
}
Docker-compose form of environment variables.
environment:
SchedulerJob__WebhookDispatcherIntervalInMinute:"1"
SchedulerJob__WebhookAlertMailDispatcherIntervalInMinute:"30"
SchedulerJob__FailedWebhookAlertThreshold:"25"
- WebhookDispatcherIntervalInMinute: Specifies the frequency of webhook dispatch in minutes.
- WebhookAlertMailDispatcherIntervalInMinute: Specifies the frequency of sending webhook alert emails in minutes.
- FailedWebhookAlertThreshold: The threshold of failed webhooks after which an alert will be triggered.
4. Azure
{
"Azure": {
"ConnectionString": "{Your Azure connection string here}",
"CDN": "{Your CDN URL here}",
"PublishedContentFolder": "published-content",
"MBTilerZipsFolder": "mbtiler-zips",
"MapscaleCadsFolder": "mapscale-cads",
"FeatureImagesFolder": "feature-images",
"FilesFolder": "files",
"MBTilerFolder": "mbtiler",
"MapscaleResultsFolder": "mapscale-results",
"StylesWithContentsFolder": "style-with-map-metadata",
"StylesFolder": "styles",
"CadToGeojsonFolder": "cad-to-geojson",
"GeojsonToPngFolder": "geojson-to-png",
"ImdfFolder": "imdf"
}
}
Docker-compose form of environment variables.
environment:
Azure__ConnectionString: "{Your Azure connection string here}"
Azure__CDN: "{Your CDN URL here}"
Azure__PublishedContentFolder: "published-content"
Azure__MBTilerZipsFolder: "mbtiler-zips"
Azure__MapscaleCadsFolder: "mapscale-cads"
Azure__FeatureImagesFolder: "feature-images"
Azure__FilesFolder: "files"
Azure__MBTilerFolder: "mbtiler"
Azure__MapscaleResultsFolder: "mapscale-results"
Azure__StylesWithContentsFolderr: "style-with-map-metadata"
Azure__StylesFolder: "styles"
Azure__CadToGeojsonFolder: "cad-to-geojson"
Azure__GeojsonToPngFolder: "geojson-to-png"
Azure__ImdfFolder: "imdf"
- ConnectionString: The connection string used to access Azure services.
- CDN: The URL for the Content Delivery Network (CDN).
- Other keys specify the names of the respective Azure Blob storage containers.
5. ApplicationConfigurations
{
"ApplicationConfigurations": {
"StyleJsonUrl": "{Style JSON URL here}",
"TaxonomyJsonUrl": "{Taxonomy JSON URL here}",
"PathfinderApiBaseUrl": "{Pathfinder API base URL here}",
"PathfinderApiSecret": "{Pathfinder API secret here}",
"PathFinderServiceEnabled": true,
"MbtilerApiBaseUrl": "{MBTiler API base URL here}",
"MbtilerApiSecret": "{MBTiler API secret here}",
"MapScaleRestApiBaseUrl": "{MapScale REST API URL here}",
"MapScaleEngineBaseUrl": "{MapScale Engine URL here}",
"MapScaleEngineSecret": "{MapScale Engine secret here}",
"MapBaseUrl": "{Map base URL here}",
"PointrCloudDashboardUrl": "{Dashboard URL here}",
"NoReplyMailAddress": "no-reply@pointr.tech",
"NoReplyMailName": "Pointr",
"UseDummyDataForMbtiles": false
}
}
Docker-compose form of environment variables.
environment:
ApplicationConfigurations__StyleJsonUrl: "{Style JSON URL here}"
ApplicationConfigurations__TaxonomyJsonUrl: "{Taxonomy JSON URL here}"
ApplicationConfigurations__PathfinderApiBaseUrl: "{Pathfinder API base URL here}"
ApplicationConfigurations__PathfinderApiSecret: "{Pathfinder API secret here}"
ApplicationConfigurations__PathFinderServiceEnabled: "true"
ApplicationConfigurations__MbtilerApiBaseUrl: "{MBTiler API base URL here}"
ApplicationConfigurations__MbtilerApiSecret: "{MBTiler API secret here}"
ApplicationConfigurations__MapScaleRestApiBaseUrl: "{MapScale REST API URL here}"
ApplicationConfigurations__MapScaleEngineBaseUrl: "{MapScale Engine URL here}"
ApplicationConfigurations__MapScaleEngineSecret: "{MapScale Engine secret here}"
ApplicationConfigurations__MapBaseUrl: "{Map base URL here}"
ApplicationConfigurations__PointrCloudDashboardUrl: "{Dashboard URL here}"
ApplicationConfigurations__NoReplyMailAddress: "no-reply@pointr.tech"
ApplicationConfigurations__NoReplyMailName: "Pointr"
ApplicationConfigurations__UseDummyDataForMbtiles: "false"
- StyleJsonUrl and TaxonomyJsonUrl: URLs for the application's style and taxonomy files.
- PathfinderApiBaseUrl and PathfinderApiSecret: Base URL and secret key for accessing the Pathfinder API.
- Other keys contain similar information for various APIs and services, including secrets and base URLs.
- NoReplyMailAddress and NoReplyMailName: The no-reply email address and name used for outbound emails.
- UseDummyDataForMbtiles: A setting indicating whether to use dummy data for Mbtiles.
Notes:
- Since the keys in ApplicationConfigurations are saved in the database, use Application Configurations endpoints for parameter updates.
6. Auth
{
"Auth": {
"JWT": {
"PointrClientSecret": "{Your JWT client secret here}"
}
}
}
Docker-compose form of environment variables.
environment:
Auth__JWT__PointrClientSecret: "{Your JWT client secret here"
- PointrClientSecret: The client secret used for JWT authentication.
7. Serilog
{
"Serilog": {
"Using": [ "Serilog.Sinks.Console" ],
"MinimumLevel": {
"Default": "Information",
"Override": {
"Microsoft": "Information",
"System": "Information",
"Microsoft.EntityFrameworkCore.Database.Command": "Warning",
"Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor": "Warning"
}
},
"WriteTo": [
{
"Name": "Console",
"Args": {
"theme": "Serilog.Sinks.SystemConsole.Themes.SystemConsoleTheme::Literate, Serilog.Sinks.Console",
"outputTemplate": "[{Level} {@Timestamp:yyyy-MM-dd HH:mm:ss}] [Message: {Message} {Exception}]{NewLine}"
}
},
{
"Name": "CustomFile",
"Args": {
"path": "logs/log-.txt"
}
}
],
"Enrich": ["FromLogContext", "WithMachineName", "WithProcessId", "WithThreadId"],
"Destructure": [
{
"Name": "ToMaximumDepth",
"Args": { "maximumDestructuringDepth": 20 }
},
{
"Name": "ToMaximumStringLength",
"Args": { "maximumStringLength": 5000 }
},
{
"Name": "ToMaximumCollectionCount",
"Args": { "maximumCollectionCount": 20 }
}
],
"Properties": {
"Application": "Pointr.Microservice.Content.API"
}
}
}
Docker-compose form of environment variables.
environment:
Serilog__Using__0: "Serilog.Sinks.Console"
Serilog__MinimumLevel__Default: "Information"
Serilog__MinimumLevel__Override__Microsoft: "Information"
Serilog__MinimumLevel__Override__System: "Information"
Serilog__MinimumLevel__Override__Microsoft.EntityFrameworkCore.Database.Command: "Warning"
Serilog__MinimumLevel__Override__Microsoft.AspNetCore.Mvc.Infrastructure.ObjectResultExecutor: "Warning"
Serilog__WriteTo__0__Name: "Console"
Serilog__WriteTo__0__Args__theme: "Serilog.Sinks.SystemConsole.Themes.SystemConsoleTheme::Literate, Serilog.Sinks.Console"
Serilog__WriteTo__0__Args__outputTemplate: "[{Level} {@Timestamp:yyyy-MM-dd HH:mm:ss}] [Message: {Message} {Exception}]{NewLine}"
Serilog__WriteTo__1__Name: "CustomFile"
Serilog__WriteTo__1__Args__path: "logs/log-.txt"
Serilog__Enrich__0: "FromLogContext"
Serilog__Enrich__1: "WithMachineName"
Serilog__Enrich__2: "WithProcessId"
Serilog__Enrich__3: "WithThreadId"
Serilog__Destructure__0__Name: "ToMaximumDepth"
Serilog__Destructure__0__Args__maximumDestructuringDepth: "20"
Serilog__Destructure__1__Name: "ToMaximumStringLength"
Serilog__Destructure__1__Args__maximumStringLength: "5000"
Serilog__Destructure__2__Name: "ToMaximumCollectionCount"
Serilog__Destructure__2__Args__maximumCollectionCount: "20"
Serilog__Properties__Application: "Pointr.Microservice.Content.API"
- Using: Specifies the Serilog sinks in use, such as
"Serilog.Sinks.Console"
for console logging. - MinimumLevel: Sets the minimum logging level to
Warning
, with specific overrides available for Microsoft and System namespaces. - WriteTo: Defines where log output is sent, using a compact JSON formatter for console output.
- Enrich: Add contextual data to logs, such as machine name and process ID.
- Destructure: Configures destructuring with limits on depth, string length, and collection count to manage log size and detail.
- Properties: Additional properties to include in every log, like specifying the application name.
Notes:
This documentation is designed to make the configuration more comprehensible and guide you in making necessary adjustments where needed. It includes explanations of what each setting is for and important considerations when making changes.