{"record":{"id":"54e53afe3abe24db","repo":"dotnet/orleans","slug":"key-is-not-configured","errorCode":null,"errorMessage":"{key} is not configured.","messagePattern":"(.+?) is not configured\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"samples/Deployment/AzureContainerApps/Infrastructure/AzureTableServiceClientFactory.cs","lineNumber":51,"sourceCode":"\n        var connectionString = configuration[\"AzureTable:ConnectionString\"];\n        if (environment.IsDevelopment()\n            && string.Equals(connectionString, \"UseDevelopmentStorage=true\", StringComparison.OrdinalIgnoreCase))\n        {\n            return new TableServiceClient(connectionString);\n        }\n\n        throw new InvalidOperationException(\n            \"Configure AzureTable:ServiceUri for Azure, or use Azurite with \"\n            + \"AzureTable:ConnectionString=UseDevelopmentStorage=true in Development.\");\n    }\n\n    public static string GetRequiredValue(IConfiguration configuration, string key)\n    {\n        var value = configuration[key];\n        return !string.IsNullOrWhiteSpace(value)\n            ? value\n            : throw new InvalidOperationException($\"{key} is not configured.\");\n    }\n}\n","sourceCodeStart":33,"sourceCodeEnd":54,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/samples/Deployment/AzureContainerApps/Infrastructure/AzureTableServiceClientFactory.cs#L33-L54","documentation":"An InvalidOperationException thrown by the generic GetRequiredValue helper in AzureTableServiceClientFactory when a requested configuration key (e.g., AZURE_CLIENT_ID, or any key passed by the endpoint-config extension) is null or whitespace. It is the shared fail-fast guard for any required setting read through this helper.","triggerScenarios":"GetRequiredValue is called for a key whose IConfiguration value is null/empty/whitespace. Currently called for AZURE_CLIENT_ID (when ServiceUri is set) and from OrleansEndpointConfigurationExtensions for the advertised ports.","commonSituations":"A required env var/app-setting not provisioned in the container app. Key renamed in code but not in the deployment manifest. Local run missing the variable.","solutions":["Set the configuration key named in the {key} placeholder to a non-empty value in the container app/environment.","Audit the deployment manifest (Bicep/manifests) to ensure every key read via GetRequiredValue is provisioned.","Add a config-validation step at startup that lists all required keys and their resolved status."],"exampleFix":"// before\npublic static string GetRequiredValue(IConfiguration configuration, string key)\n{\n    var value = configuration[key];\n    return !string.IsNullOrWhiteSpace(value)\n        ? value\n        : throw new InvalidOperationException($\"{key} is not configured.\");\n}\n\n// after (collect all missing keys)\npublic static string GetRequiredValue(IConfiguration configuration, string key) =>\n    configuration[key] is { Length: > 0 } value && !value.All(char.IsWhiteSpace)\n        ? value\n        : throw new InvalidOperationException($\"{key} is not configured. Check app settings / env vars.\");","handlingStrategy":"validation","validationCode":"foreach (var key in new[] { \"AZURE_CLIENT_ID\", \"Orleans:AdvertisedSiloPort\", \"Orleans:AdvertisedGatewayPort\" }) {\n    if (string.IsNullOrWhiteSpace(configuration[key]))\n        throw new InvalidOperationException($\"{key} is not configured.\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Provision every key read via GetRequiredValue in your deployment manifest.","Use a startup config validator that lists all required keys at once.","Keep code key names and deployment variables in sync."],"tags":["azure-storage","configuration","startup","azure-container-apps","validation"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}