{"record":{"id":"8c0f002cc676c792","repo":"dotnet/orleans","slug":"the-required-setting-name-isn-t-configured","errorCode":null,"errorMessage":"The required setting '{name}' isn't configured.","messagePattern":"The required setting '(.+?)' isn't configured\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"samples/Deployment/AzureAppService/Silo/Program.cs","lineNumber":155,"sourceCode":"            .UseAzureStorageClustering(options =>\n            {\n                options.TableServiceClient = tableServiceClient;\n                options.TableName = $\"{clusterId}Clustering\";\n            })\n            .AddAzureTableGrainStorage(\n                \"shopping-cart\",\n                options =>\n                {\n                    options.TableServiceClient = tableServiceClient;\n                    options.TableName = $\"{clusterId}Persistence\";\n                });\n    });\n}\n\nstatic string GetRequiredSetting(WebApplicationBuilder builder, string name) =>\n    builder.Configuration[name] is { } value && !string.IsNullOrWhiteSpace(value)\n        ? value\n        : throw new InvalidOperationException($\"The required setting '{name}' isn't configured.\");\n","sourceCodeStart":137,"sourceCodeEnd":156,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/samples/Deployment/AzureAppService/Silo/Program.cs#L137-L156","documentation":"An InvalidOperationException thrown by the GetRequiredSetting helper in the Azure App Service silo Program.cs when a required configuration key (e.g., ORLEANS_CLUSTER_ID, ORLEANS_SERVICE_ID, ORLEANS_AZURE_STORAGE_URI, AZURE_CLIENT_ID, WEBSITE_PRIVATE_IP) is null or whitespace. It is a fail-fast guard ensuring the silo cannot start half-configured.","triggerScenarios":"Any of the required settings passed to GetRequiredSetting is absent from builder.Configuration (appsettings, env vars, App Service settings). The null-coalesce + IsNullOrWhiteSpace check triggers the throw naming the missing key.","commonSituations":"Deploying the App Service without configuring the application settings. Renaming a key in code but not in the deployment template (Bicep/ARM). Local run missing environment variables.","solutions":["Set every required key listed in the error's 'name' placeholder in the App Service Configuration blade (or local environment/appsettings).","Cross-check the keys against the deployment template (Bicep/ARM/terraform) that provisions the App Service.","Add a startup config-validation log that dumps which keys resolved, to catch misnamed keys early."],"exampleFix":"// before\nstatic string GetRequiredSetting(WebApplicationBuilder builder, string name) =>\n    builder.Configuration[name] is { } value && !string.IsNullOrWhiteSpace(value)\n        ? value\n        : throw new InvalidOperationException($\"The required setting '{name}' isn't configured.\");\n\n// after (list all missing keys at once)\nstatic string GetRequiredSetting(WebApplicationBuilder builder, string name)\n{\n    var value = builder.Configuration[name];\n    if (string.IsNullOrWhiteSpace(value))\n        throw new InvalidOperationException(\n            $\"The required setting '{name}' isn't configured. \" +\n            $\"Configured keys starting with 'ORLEANS': \" +\n            $\"{string.Join(\", \", builder.Configuration.AsEnumerable().Where(kv => kv.Key.StartsWith(\"ORLEANS\")).Select(kv => kv.Key))}.\");\n    return value;\n}","handlingStrategy":"validation","validationCode":"string[] required = [\"ORLEANS_CLUSTER_ID\",\"ORLEANS_SERVICE_ID\",\"ORLEANS_AZURE_STORAGE_URI\",\"AZURE_CLIENT_ID\",\"WEBSITE_PRIVATE_IP\",\"WEBSITE_PRIVATE_PORTS\"];\nvar missing = required.Where(k => string.IsNullOrWhiteSpace(builder.Configuration[k])).ToList();\nif (missing.Count > 0) throw new InvalidOperationException(\"Missing settings: \" + string.Join(\", \", missing));","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provision every required App Service setting via your deployment template.","Log resolved config keys at startup to catch typos/renames.","Keep the Bicep/ARM and code key lists in sync."],"tags":["deployment","azure-app-service","configuration","startup","validation"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}