Exam Area: Content Area 2 – Installation, Operation & Configuration (20%)
Reference: https://docs.developers.optimizely.com/content-management-system/docs/deploying-to-windows-servers
When deploying to multiple servers/instances, you must handle:
// Startup.cs
// Requires shared cache and event provider configuration
// 1. Shared cache via Redis
builder.Services.AddStackExchangeRedisCache(options =>
{
options.Configuration = Configuration.GetConnectionString("Redis");
});
// 2. Azure Event Provider (for multi-instance events)
builder.Services.AddAzureServiceBusEventProvider(options =>
{
options.ConnectionString = Configuration["ServiceBus"];
options.TopicName = "cms-events";
});
Internet → IIS → CMS App → SQL Server
→ File System (BLOB)
Internet → Load Balancer → Server 1 (CMS)
→ Server 2 (CMS)
↓
SQL Server (Shared)
Azure Blob Storage (Shared)
Redis Cache (Shared)
Internet → Azure Front Door (CDN) → Azure App Service
→ Azure SQL Database
→ Azure Blob Storage
→ Redis Cache
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<location path="." inheritInChildApplications="false">
<system.webServer>
<handlers>
<add name="aspNetCore" path="*" verb="*"
modules="AspNetCoreModuleV2"
resourceType="Unspecified" />
</handlers>
<aspNetCore processPath="dotnet"
arguments=".\MyOptimizelySite.dll"
stdoutLogEnabled="false"
stdoutLogFile=".\logs\stdout"
hostingModel="inprocess" />
</system.webServer>
</location>
</configuration>
// If using sessions, a distributed session store is required
builder.Services.AddDistributedMemoryCache(); // DEV only
// Production: Use Redis
builder.Services.AddStackExchangeRedisCache(options =>
{
options.Configuration = "redis-connection-string";
});
builder.Services.AddSession();
// Add health checks
builder.Services.AddHealthChecks()
.AddSqlServer(connectionString)
.AddCheck<CmsHealthCheck>("cms");
app.MapHealthChecks("/health");
Build the application:
dotnet publish -c Release -o ./publish
Copy files to the server
Configure IIS:
Database Connection String in appsettings.Production.json
Run database migrations (if manual)
<!-- web.config - Pre-warmup -->
<system.webServer>
<applicationInitialization doAppInitAfterRestart="true">
<add initializationPage="/" />
</applicationInitialization>
</system.webServer>
dotnet publish command used for? (Build and publish output for deployment)