Exam Area: Content Area 2 – Installation, Operation & Configuration (20%)
Reference: https://docs.developers.optimizely.com/content-management-system/docs/configuration
{
"ConnectionStrings": {
"EPiServerDB": "Server=.;Database=MyCMSDb;Trusted_Connection=True;TrustServerCertificate=True"
},
"EPiServer": {
"CMS": {
"DefaultLanguage": "en",
"UIUrl": "~/episerver/cms/",
"AdminUIUrl": "~/episerver/cms/admin/"
},
"Framework": {
"AutoUpdateDatabaseSchema": true,
"AppDataPath": "App_Data"
}
}
}
{
"EPiServer": {
"Framework": {
"DataAccess": {
"ConnectionString": "EPiServerDB",
"CommandTimeout": "60"
}
}
}
}
// In Program.cs - detailed configuration
builder.Services.Configure<CmsOptions>(options =>
{
options.DefaultLanguage = "en";
options.EnableInlineBlockEditing = true;
});
Configuration file for CMS modules:
<!-- module.config in module folder or embedded in assembly -->
<?xml version="1.0" encoding="utf-8"?>
<module>
<assemblies>
<add assembly="MyOptimizelySite" />
</assemblies>
<clientResources>
<add name="MyCustomScript" path="ClientResources/Scripts/myScript.js" resourceType="Script" />
</clientResources>
<requiredResources>
<add name="MyCustomScript" />
</requiredResources>
</module>
// Change URLs for Edit and Admin views
builder.Services.Configure<UIOptions>(options =>
{
options.EditUrl = new Uri("/cms/edit", UriKind.Relative);
});
{
"EPiServer": {
"CMS": {
"UIUrl": "~/myedit/",
"AdminUIUrl": "~/myadmin/"
}
}
}
// Azure Blob Storage
builder.Services.AddAzureBlobProvider(options =>
{
options.ConnectionString = "DefaultEndpointsProtocol=https;AccountName=...";
options.ContainerName = "my-cms-blobs";
});
// File system (default)
builder.Services.Configure<FileBlobOptions>(options =>
{
options.Path = Path.Combine(builder.Environment.ContentRootPath, "App_Data/blobs");
});
{
"EPiServer": {
"Framework": {
"Cache": {
"LocalCacheSize": 10000,
"RemoteCacheEnabled": true
}
}
}
}
// Object cache configuration
builder.Services.Configure<CacheManagerOptions>(options =>
{
options.Enabled = true;
options.MemoryCacheEntryOptions = new MemoryCacheEntryOptions
{
SlidingExpiration = TimeSpan.FromMinutes(10)
};
});
{
"EPiServer": {
"CMS": {
"ScheduledJobsEnabled": true
}
}
}
{
"EPiServer": {
"Find": {
"ServiceUrl": "https://es-api.episerver.net",
"DefaultIndex": "mysite_index"
}
}
}
{
"Logging": {
"LogLevel": {
"Default": "Information",
"Microsoft.AspNetCore": "Warning",
"EPiServer": "Information"
}
},
"Serilog": {
"WriteTo": [
{
"Name": "File",
"Args": {
"path": "Logs/cms-.log",
"rollingInterval": "Day"
}
}
]
}
}
appsettings.json → Base configuration
appsettings.Development.json → Development overrides
appsettings.Production.json → Production overrides
appsettings.Staging.json → Staging overrides
// appsettings.Development.json
{
"EPiServer": {
"Framework": {
"AutoUpdateDatabaseSchema": true
}
}
}
// appsettings.Production.json
{
"EPiServer": {
"Framework": {
"AutoUpdateDatabaseSchema": false
}
}
}
EPiServerDB)AutoUpdateDatabaseSchema be enabled? (Development; disabled in Production)module.config used for? (Configuring CMS modules and client resources)UIOptions.EditUrl)AddAzureBlobProvider())