Configuration Reference

This is the quick-reference manual for all configuration in EasyAdminBlazor v2.7.0: code options, appsettings sections, database-backed sys_config settings, and environment variables. Only keys that the current code actually reads are listed; deleted or ineffective keys are called out under "Common Pitfalls".

Where configuration comes from

Four sources, later ones override earlier ones:

Priority Source Notes
1 (highest) Request-scope override In multi-tenant mode TenantConfigurationScopeFilter injects the current tenant's configuration (a dedicated database or a shared-database row, EasyAdminBlazor.Core/Infrastructure/Configuration/ConfigurationScope.cs:23)
2 Database snapshot The sys_config table, injected at startup by AddDatabaseConfiguration(fsql) (EasyAdminBlazor/AdminExtensions.Infrastructure.cs:108); blank rows are filtered out and fall back to appsettings
3 appsettings.json / environment variables Standard ASP.NET Core configuration providers
4 (lowest) Code defaults Option-property initializers, configure delegates, PostConfigure

Two things that are easy to get wrong:

  • EasyAdminBlazorOptions is not bound to any appsettings section. The host assigns it in code via AddEasyAdminBlazor(new EasyAdminBlazorOptions { ... }), which is then projected into IOptions<EasyAdminBlazorOptions> (EasyAdminBlazor/AdminExtensions.cs:219-249). Configure it in code, not in appsettings.json.
  • AesKey is required. When missing, encrypting/decrypting sensitive fields throws immediately (EasyAdminBlazorOptions.cs:42, AesEncrypt.cs:30-36). Supply it in code or through the EasyAdmin__AesKey environment variable. Changing it invalidates existing logins.

1. Code option EasyAdminBlazorOptions

All properties are defined in EasyAdminBlazor.Core/EasyAdminBlazorOptions.cs. Host entry point:

builder.AddEasyAdminBlazor(new EasyAdminBlazorOptions
{
    AesKey = "...",                 // required
    WorkId = 1,
    EnableLocalization = true,
    // ...
});
Property Type Default Purpose
WorkId ushort 1 Snowflake machine id, 0–63; must be unique across instances or primary keys collide
Assemblies Assembly[]? null (entry assembly auto-filled) Razor component routing assemblies; extensions append via AddEasyAdminBlazorAssembly
LocaleAssemblies Assembly[]? null Assemblies embedding Locales/*.json, appended by extension registration
FreeSqlBuilder Action<FreeSqlBuilder>? null Configure connection string, auto-sync structure, SQL logging
EnableLocalization bool false (true in Demo) Localization master switch
EnableLangRoute bool false (true in Demo) Render front office by URL language prefix (/en-US/...); back office unaffected. See Language Routing
ShowHelp bool false Back-office help entry
EnableLoginCaptcha bool false (true in Demo) Login CAPTCHA, requires the Captcha extension
EnableMessage bool false (true in Demo) Message center; depends only on the database and SignalR, not Redis
EnableMultiTenant bool false Multi-tenancy switch; the MultiTenant extension forces it to true via PostConfigure, no manual setting needed
AesKey string "" (required) Root key for sensitive-field encryption, Data Protection application-name derivation, and BotGuard challenge ticket signing
CookieName string "" Login cookie name
AdminRouteSecret string "" Back-office entry secret; can also be overridden by a same-named system setting in the current tenant data source
DefaultThemeColor string "" Default primary colour (hex); empty uses the built-in colour, a user's manual choice wins
TicketLifetime TimeSpan 7 days Login ticket lifetime, enforced server-side; non-positive falls back to the default
CopyRight string Copyright © 2025-{current year} EasyAdminBlazor Copyright text on the login page and back-office footer
ShowSourceLink bool true "Get Source Code" header entry; set false for source-license holders
SchedulerExecuting Action<IServiceProvider, SchedulerTaskData>? null Callback-style task registration entry point
SchedulerExecutingTenantScope SchedulerTenantScope Host Fan-out scope for callback tasks: Host / EachTenant / HostAndEachTenant
EnableSchedulerTenantTasks bool false Per-tenant task rows: each target gets its own task row in the main database ({tenantCode}.{Topic})
TenantMenuScopeByPlan bool true Provision only the menus ticked in a tenant's plan; false provisions all menus (host-only paths still excluded)
EnableContentOverlay bool false Render the back-office content-area slot IFeatureGateOverlayExtension; the framework provides no overlay component or verdict
EnableKickOnOtherLogin bool true Kick out a session logged in elsewhere
DataProtectionKeyPath string "" Data Protection key persistence directory; on IIS configure a path outside the application directory
DataProtectionApplicationName string "" Key-ring application name, effective only when DataProtectionKeyPath is set; otherwise derived from the first 16 bytes of the SHA-256 of AesKey
CircuitAutoPauseHiddenDelay TimeSpan 2 minutes How long a hidden tab stays visible before its circuit pauses; .NET 11 only (automatic)
CircuitPauseDrainTimeout TimeSpan 10 seconds Maximum wait for circuits to drain before an upgrade shutdown; .NET 11 only

2. appsettings sections

2.1 Connection strings and standard keys

Key Example / default Purpose
ConnectionStrings:Default Data Source=easyadminblazor.db Main-database connection string, read at Demo Program.cs:46; for MySQL / SQL Server see Changing Database Types
Redis:ConnectionString 127.0.0.1:6379,poolsize=10 Redis connection string (chat, cache extensions); empty degrades to in-memory
Logging:LogLevel:Default Information Standard ASP.NET Core log level; database logging see Serilog Configuration
AllowedHosts * ASP.NET Core host filter; a different thing from Security:AllowedHosts

2.2 FileSettings (files and uploads)

All are hard-coded keys with no Options class; reads are concentrated in EasyAdminBlazor/Infrastructure/Service/FileService.cs.

Key Type Default Purpose
FileSettings:DirectoryName string uploads Upload root directory (relative to content root)
FileSettings:IncludeExtension string[] 12 common document/image formats Allowed extensions, read once at registration
FileSettings:ExcludeExtension string[] exe/dll/php/aspx etc. Explicitly blocked extensions
FileSettings:DateTimeDirectory string yyyy/MM/dd Date sub-directory format
FileSettings:PrivateRoot string "" (off) Private upload root outside wwwroot; no SysFile row, no public URL. AI image upload depends on it, see File Management
FileSettings:KeepOriginalFile bool false When true, non-WebP originals are kept as-is (no transcode/resize); oversized WebP is still resized
FileSettings:MaxImageWidth int 1600 (Demo 800) Max width before an oversized image is resized
FileSettings:WebpQuality int 80 WebP compression quality
FileSettings:MaxImagePixels long 40000000 Max total pixels per image (width × height), 0 = unlimited; guards against decompression bombs

2.3 Security

Bound to SecurityOptions; full details in Security Configuration.

Key Type Default Purpose
Security:MaxUploadSize long 10485760 (10MB) Max bytes per file, shared by the HTTP and business layers
Security:MaxRemoteRedirects int 3 Max redirects when downloading a remote image
Security:LoginFailureLimit int 5 Failed-login lockout threshold; non-positive falls back to default
Security:LoginLockout TimeSpan 00:10:00 Lockout duration; non-positive falls back to default
Security:AllowedHosts string[] [] (unrestricted) Host allow-list; in multi-tenant mode prevents Host-header spoofing to switch tenants; supports *.example.com
Security:AntiforgeryEnabled bool true CSRF protection master switch
Security:AntiforgeryHeaderName string X-CSRF-TOKEN Token header when no cookie is available
Security:RateLimitEnabled bool true Anonymous endpoint rate limiting (currently consumed by the WeChat extension)
Security:RateLimitPermitLimit int 60 Global tightening cap; the smaller of this and each endpoint's limit wins
Security:RateLimitWindow TimeSpan 00:01:00 Rate-limit window
Security:ExternalApiTimeout TimeSpan 00:00:10 Timeout for third-party calls such as WeChat

2.4 Scheduler (scheduled tasks)

Key Type Default Purpose
Scheduler:TimeZoneId string none Scheduler time zone (IANA or Windows name), e.g. Asia/Shanghai; takes precedence over the offset
Scheduler:UtcOffsetHours double 8 Fixed offset when TimeZoneId is absent; defaults to +8 (legacy behaviour)

2.5 Upgrade (application upgrades)

Bound to UpgradeOptions; see Application Upgrades.

Key Type Default Purpose
Upgrade:Enabled bool false Enable "Check for Updates"; forcibly disabled by the framework under IIS in-process hosting
Upgrade:ApplicationName string "" Application name; empty uses the entry assembly name
Upgrade:CurrentVersion string "" Application version; empty uses the csproj <Version>
Upgrade:Source string Local Publish source: Local or Url
Upgrade:ReleasesPath string updates Local release directory
Upgrade:ReleaseIndexUrl string "" URL of the release index
Upgrade:AllowInsecureHttp bool false Allow plaintext http downloads
Upgrade:RestartMode string Direct Direct / WindowsService / Systemd / External
Upgrade:ServiceName string "" Service name in service modes
Upgrade:HealthCheckUrl string "" Health-check URL; inferred from listening addresses when empty
Upgrade:HealthCheckTimeoutSeconds int 30 Total health-check timeout (seconds)
Upgrade:HealthCheckIntervalSeconds int 1 Health-check polling interval (seconds)
Upgrade:HostExitTimeoutSeconds int 30 Timeout waiting for the application to exit (seconds)
Upgrade:HealthCheckAllowInvalidCertificate bool true Ignore certificate errors for https health checks (local self-signed scenarios)
Upgrade:UpdaterPath string updater Updater directory (relative to the application)
Upgrade:ExtraProtectedPaths string[] [] Extra protected paths appended to the defaults (uploads/logs/keys/config/databases etc.)

2.6 Mail

Bound to MailSettings / SmtpSettings and resolved by the Mail extension.

  • Mail:Provider: Auto (default) / Smtp / SendCloud / TencentCloud
  • New layout: Mail:Smtp:Server/Port/Username/Password/FromEmail/FromName/EnableSsl, Mail:SendCloud:ApiUser/ApiKey/SenderEmail/SenderName, Mail:TencentCloud:SecretId/SecretKey/Region/FromEmail/FromName/ReplyToAddresses/Endpoint
  • Legacy layout (what the admin settings page saves): top-level SmtpSettings:*, SendCloud:*, TencentCloud:*; non-empty legacy values take precedence

2.7 Sms

Bound to SmsOptions (re-read on each send); see SMS Extension.

Key Default Purpose
Sms:Provider Auto Auto / Aliyun / Tencent / SendCloud; Auto picks the first fully configured provider
Sms:EnableLogging true Record every result (including failures) in SysSmsLog
Sms:Aliyun:AccessKeyId/AccessKeySecret/SignName empty Alibaba Cloud SMS
Sms:Tencent:SecretId/SecretKey/SdkAppId/SignName/Region Region ap-guangzhou Tencent Cloud SMS
Sms:SendCloud:SmsUser/SmsKey/Tag empty SendCloud SMS
Sms:Code:TemplateCode empty OTP template code
Sms:Code:Length 6 OTP digit count
Sms:Code:TtlMinutes 10 OTP validity (minutes)
Sms:Code:SendIntervalSeconds 60 Minimum interval between sends to one number (seconds)
Sms:Code:HourlyLimit 10 Max messages per number per hour

2.8 Ai (AI extension)

Bound to AiOptions; the configure delegate runs after configuration binding and overrides it. The framework does no quota enforcement — allowing a call is up to the host via IAiAccessGuard; see AI Extension.

Key Default Purpose
Ai:Enabled true Master switch; when off the initializer does not take over menus and the service layer rejects calls
Ai:RequestTimeoutSeconds 120 Per-request model timeout (each tool round trips separately)
Ai:TurnTimeoutSeconds 600 Whole-turn timeout, also the HTTP timeout sent to the provider
Ai:ToolIterationsPerTurn 8 Max tool round-trips per turn
Ai:RateLimitPerMinute 60 Per-user calls per minute, 0 = unlimited
Ai:DefaultScene chat Default scene code
Ai:InjectUserIdentity true Append current user identity to the system prompt (not a permission boundary)
Ai:OnDemandTools true Load tool schemas on demand instead of sending every schema up front
Ai:AllowPrivateModelEndpoints false Allow model endpoints on localhost/intranet; never enable in multi-tenant SaaS
Ai:FreeTokenGrant 0 Read by the host when granting tokens; not used by the framework for gating
Ai:QuotaExhaustedHint Chinese message Host-facing message template; {0} is replaced with tokens used

The framework has no quota-reservation options such as ReservedOutputTokens or CharsPerEstimatedToken — do not configure them.

2.9 BotGuard (access gate)

Bound to BotGuardOptions, off by default, and the host must mount the middleware explicitly; full field details in Human Verification and Access Gate.

Key Default Purpose
BotGuard:Enabled false Master switch
BotGuard:ExemptLoopback true Allow loopback addresses
BotGuard:ExemptAuthenticated true Allow signed-in users
BotGuard:ChallengeEnabled true Issue a PoW challenge on anonymous HTML pages; false returns 403 directly
BotGuard:ChallengeCookieName eab_bot Challenge cookie name
BotGuard:ChallengeLifetime 30 days Challenge cookie lifetime
BotGuard:ChallengeDifficulty 20 PoW leading-zero bits, valid 1–24
BotGuard:CrawlerVerification ReverseDns UserAgentOnly / ReverseDns / ReverseDnsAndIpRange
BotGuard:IncludeDefaultCrawlers true Merge the built-in Bing / Baidu rules
BotGuard:Crawlers [] Additional/overriding crawler rules (name, UA keywords, reverse-DNS suffixes, official IP-range URLs)
BotGuard:ExemptPaths /api/ etc. Challenge-exempt paths; a trailing / means prefix match; configuring replaces the default list
BotGuard:ExemptExtensions scripts/styles/images/fonts Challenge-exempt static extensions
BotGuard:ProtectedPaths /_blazor, /hubs/ Require a challenge cookie or login; otherwise 403 directly
BotGuard:RateLimit:Enabled true Per-IP rate limiting
BotGuard:RateLimit:PermitLimit 120 Requests per window
BotGuard:RateLimit:Window 1 minute Rate-limit window
BotGuard:GlobalConcurrencyLimit 0 (unlimited) Concurrent short requests entering downstream; over the limit returns 503; long-lived connections don't count
BotGuard:DnsTimeout 2 seconds Per-query DNS timeout
BotGuard:VerificationCacheDuration 24 hours Cache duration for successful crawler verification
BotGuard:NegativeVerificationCacheDuration 5 minutes Cache duration for failed verification
BotGuard:IpRangeCacheDuration 24 hours Official IP-range cache
BotGuard:IpRangeFailureCacheDuration 10 minutes Cache after an IP-range fetch failure
BotGuard:LogBlockedRequests true Log rejected requests

2.10 Other extension sections

Section Keys Default / notes
TenantDeployment Mode / TenantCode Mode: Hosted (default) / SelfHosted; set TenantCode in SelfHosted mode
Wechat:App AppKey / AppSecret Mini program; also editable on the admin settings page (keys WeChat:App:*; .NET config keys are case-insensitive)
Wechat:PayV3 AppId / AppSecret / MchId / ApiV3Key / CertificatePath / KeyPath / NotifyUrl / BaseUrl / PubPath / P12Path / P12Password WeChat Pay V3
TinyMCE ScriptSrc Editor script URL; empty falls back to the built-in CDN
Redis ConnectionString Redis connection string
Cache DefaultExpirationMinutes Default 30, FusionCache extension
AliyunSms AccessKeyId / AccessKeySecret / SignName Legacy SMS extension, no longer maintained; use Sms for new projects
BootstrapBlazorOptions DefaultCultureInfo / SupportedCultures / FallbackCulture etc. Third-party binding; the framework's localization, language routing and MultiLang treat DefaultCultureInfo and SupportedCultures as the single language source — configure them here, not again in an extension

3. sys_config database settings (admin "Parameters" page)

There is no central key-constant class; keys live as strings in each IConfigSettingsContributor.GetSettingFields(). Field types come from ConfigSettingField: Text / Int / Bool / Select / MultiSelect / File / Color / Secret.

  • Secret fields are encrypted on save with AesKey and never echoed back (leave blank = keep the old value); reads use AesEncrypt.TryDecryptOrRaw() to stay compatible with legacy plaintext.
  • Initialization fills missing keys idempotently per prefix: if any row with the same prefix exists, newly added fields are still inserted (ConfigSettingsContributorBase.cs:81-116).
  • The "Custom" tab shows only keys without a colon; keys with colons are grouped by their contributors.
Key prefix Source Contents
SYSTEM_NAME Framework seed Site name, read by the login page, footer and AI assistant self-name
SYSTEM_ICON MultiTenant seed Site logo path
APPROVAL_FLOW_{bill type} Approval extension Flow configuration JSON; changes take effect without restart and override ApprovalOptions.Flows in code
Sms:* Sms contributor Same names as section 2.7; SendIntervalSeconds / HourlyLimit exist only in appsettings/Options, not on the page
Mail:Provider, SmtpSettings:*, SendCloud:*, TencentCloud:* Mail contributor Mail provider parameters, showing only the selected provider's fields
WeChat:App:AppKey / WeChat:App:AppSecret WeChat contributor Mini-program parameters; the secret is a Secret field
Aliyun:Sms:* Legacy AliyunSms contributor Legacy SMS parameters stored as plaintext; don't use for new projects

4. Environment variables and deployment

Item Notes
EasyAdmin__AesKey Environment-variable form of AesKey (double underscore); works without putting it in appsettings
ASPNETCORE_ENVIRONMENT Development loads appsettings.Development.json
URLS Production listening addresses, e.g. http://0.0.0.0:5099
APP_POOL_ID IIS in-process hosting detection; disables the upgrade entry when detected
DOTNET_HOST_PATH Host path of the updater at build time (used by the Upgrade extension targets)

5. Common pitfalls

  1. EasyAdminBlazorOptions has no config section: it is only assigned in code, never read from appsettings.
  2. Dual key names: Aliyun:Sms:* (settings-page seed) and AliyunSms:* (legacy Options binding) refer to different things; Wechat:App (appsettings section) and WeChat:App:* (settings-page keys) differ in case but .NET configuration is case-insensitive. New projects should use Sms:* and Wechat:App.
  3. Mail:SmtpSettings is ineffective: it appeared in the Demo, but the code reads Mail:Smtp (new layout) or top-level SmtpSettings (legacy layout).
  4. Dictionaries and caches are delayed: AdminDictSelect caches for 30 seconds and sys_config for 1 hour, so changes are not instant; saving on the Config page explicitly invalidates the cache once.
  5. AesKey affects login state: changing it changes the Data Protection application name, so all logged-in users must sign in again.
  6. .NET 11 circuit pause needs no switch: CircuitAutoPauseHiddenDelay / CircuitPauseDrainTimeout apply only to the net11 target; the two former switches were deleted, and net10 behaviour is unchanged.