dotnet/orleans · error · ArgumentException

Azure Table names must contain 3 to 63 alphanumeric characte

Error message

Azure Table names must contain 3 to 63 alphanumeric characters and begin with a letter.

What it means

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.

Source

Thrown at src/Azure/Orleans.Journaling.AzureStorage/AzureTableJournalStorageOptions.cs:134

    internal static string GetDefaultPartitionKey(JournalId journalId)
    {
        if (journalId.IsDefault)
        {
            throw new ArgumentException("The journal id must not be the default value.", nameof(journalId));
        }

        // Percent-encoding escapes every character disallowed in partition keys ('/', '\', '#', '?',
        // control characters) and is reversible.
        var partitionKey = Uri.EscapeDataString(journalId.Value);
        ValidatePartitionKey(partitionKey, nameof(journalId));
        return partitionKey;
    }

    internal static void ValidateTableName(string? tableName)
    {
        if (tableName is not { Length: >= 3 and <= 63 } || !IsAsciiLetter(tableName[0]))
        {
            throw new ArgumentException(
                "Azure Table names must contain 3 to 63 alphanumeric characters and begin with a letter.",
                nameof(TableName));
        }

        foreach (var character in tableName)
        {
            if (!IsAsciiLetter(character) && character is not (>= '0' and <= '9'))
            {
                throw new ArgumentException(
                    "Azure Table names must contain 3 to 63 alphanumeric characters and begin with a letter.",
                    nameof(TableName));
            }
        }
    }

    private static void ValidatePartitionKey(string partitionKey, string parameterName)
    {
        if (partitionKey.Length > 1024)

View on GitHub (pinned to fca799fa70)

Solutions

  1. Set TableName to 3-63 alphanumeric characters starting with a letter (e.g. 'journal', 'grainJournal').
  2. If the name is derived from an environment prefix, sanitize/validate it before assignment.
  3. Leave TableName unset to use the default 'journal'.

Example fix

// before
options.TableName = "jl"; // too short
// after
options.TableName = "grainJournal";
Defensive patterns

Strategy: validation

Validate before calling

if (tableName is null || tableName.Length < 3 || tableName.Length > 63 || !char.IsLetter(tableName[0]))
    throw new ArgumentException("Table name must be 3-63 chars starting with a letter.", nameof(tableName));

Type guard

static bool IsValidTableName(string? n) =>
    n is { Length: >= 3 and <= 63 } && char.IsLetter(n[0]) && n.All(c => char.IsLetterOrDigit(c));

Prevention

When it happens

Trigger: 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).

Common situations: 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.

Related errors


AI-assisted analysis of dotnet/orleans@fca799fa70 (2026-08-13). Data as JSON: /api/errors/2127daa12860d8c1. Report an issue: GitHub.