{"record":{"id":"2127daa12860d8c1","repo":"dotnet/orleans","slug":"azure-table-names-must-contain-3-to-63-alphanumeri","errorCode":null,"errorMessage":"Azure Table names must contain 3 to 63 alphanumeric characters and begin with a letter.","messagePattern":"Azure Table names must contain 3 to 63 alphanumeric characters and begin with a letter\\.","errorType":"validation","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Azure/Orleans.Journaling.AzureStorage/AzureTableJournalStorageOptions.cs","lineNumber":134,"sourceCode":"    internal static string GetDefaultPartitionKey(JournalId journalId)\n    {\n        if (journalId.IsDefault)\n        {\n            throw new ArgumentException(\"The journal id must not be the default value.\", nameof(journalId));\n        }\n\n        // Percent-encoding escapes every character disallowed in partition keys ('/', '\\', '#', '?',\n        // control characters) and is reversible.\n        var partitionKey = Uri.EscapeDataString(journalId.Value);\n        ValidatePartitionKey(partitionKey, nameof(journalId));\n        return partitionKey;\n    }\n\n    internal static void ValidateTableName(string? tableName)\n    {\n        if (tableName is not { Length: >= 3 and <= 63 } || !IsAsciiLetter(tableName[0]))\n        {\n            throw new ArgumentException(\n                \"Azure Table names must contain 3 to 63 alphanumeric characters and begin with a letter.\",\n                nameof(TableName));\n        }\n\n        foreach (var character in tableName)\n        {\n            if (!IsAsciiLetter(character) && character is not (>= '0' and <= '9'))\n            {\n                throw new ArgumentException(\n                    \"Azure Table names must contain 3 to 63 alphanumeric characters and begin with a letter.\",\n                    nameof(TableName));\n            }\n        }\n    }\n\n    private static void ValidatePartitionKey(string partitionKey, string parameterName)\n    {\n        if (partitionKey.Length > 1024)","sourceCodeStart":116,"sourceCodeEnd":152,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/Azure/Orleans.Journaling.AzureStorage/AzureTableJournalStorageOptions.cs#L116-L152","documentation":"Thrown by ValidateTableName when the configured TableName is shorter than 3 chars, longer than 63 chars, or does not begin with an ASCII letter. Azure Tables enforces these naming rules at the service side; this check fails fast during configuration rather than on the first remote call.","triggerScenarios":"AzureTableJournalStorageOptions.TableName is set to a value violating Azure's naming rules (length < 3 or > 63, or first character not a-z/A-Z), and validation runs (typically at provider initialization/options validation).","commonSituations":"Configuring TableName from appsettings with a typo like 'jl' or 'Journal-Logs' (hyphen invalid as first/any char); using an environment variable that produces a too-short name; prefixing with a digit.","solutions":["Set TableName to 3-63 alphanumeric characters starting with a letter (e.g. 'journal', 'grainJournal').","If the name is derived from an environment prefix, sanitize/validate it before assignment.","Leave TableName unset to use the default 'journal'."],"exampleFix":"// before\noptions.TableName = \"jl\"; // too short\n// after\noptions.TableName = \"grainJournal\";","handlingStrategy":"validation","validationCode":"if (tableName is null || tableName.Length < 3 || tableName.Length > 63 || !char.IsLetter(tableName[0]))\n    throw new ArgumentException(\"Table name must be 3-63 chars starting with a letter.\", nameof(tableName));","typeGuard":"static bool IsValidTableName(string? n) =>\n    n is { Length: >= 3 and <= 63 } && char.IsLetter(n[0]) && n.All(c => char.IsLetterOrDigit(c));","tryCatchPattern":null,"preventionTips":["Validate table names with a regex ^[a-zA-Z][a-zA-Z0-9]{2,62}$ in an IValidateOptions.","Do not reuse blob-container naming (which allows hyphens) for tables.","Prefer the default 'journal' unless you need a custom name."],"tags":["azure-table-storage","configuration","validation","naming","table-name"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T05:17:29.042Z"}