{"record":{"id":"07f72143343deab6","repo":"dotnet/orleans","slug":"no-azure-table-service-client-was-configured-set","errorCode":null,"errorMessage":"No Azure Table service client was configured. Set TableServiceClient or call ConfigureTableServiceClient.","messagePattern":"No Azure Table service client was configured\\. Set TableServiceClient or call ConfigureTableServiceClient\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"critical","filePath":"src/Azure/Orleans.Journaling.AzureStorage/AzureTableJournalStorageProvider.cs","lineNumber":39,"sourceCode":"        IServiceProvider serviceProvider,\n        ILogger<AzureTableJournalStorage> logger,\n        AzureTableJournalStorageInstruments? instruments = null)\n    {\n        _options = options.Value;\n        var journalFormatKey = ValidateJournalFormatKey(managerOptions.Value.JournalFormatKey);\n        ValidateJournalFormat(serviceProvider, journalFormatKey);\n        _shared = new AzureTableJournalStorage.AzureTableJournalStorageShared(\n            logger,\n            options,\n            _tableClientProvider,\n            instruments ?? AzureTableJournalStorageInstruments.CreateForDirectConstruction(),\n            journalFormatKey);\n    }\n\n    private async Task Initialize(CancellationToken cancellationToken)\n    {\n        var createClient = _options.CreateClient\n            ?? throw new InvalidOperationException(\n                $\"No Azure Table service client was configured. Set {nameof(AzureTableJournalStorageOptions.TableServiceClient)} \" +\n                $\"or call {nameof(AzureTableJournalStorageOptions.ConfigureTableServiceClient)}.\");\n        var client = await createClient(cancellationToken).ConfigureAwait(false)\n            ?? throw new InvalidOperationException(\"The configured Azure Table service client factory returned null.\");\n        var table = client.GetTableClient(_options.TableName);\n        await table.CreateIfNotExistsAsync(cancellationToken).ConfigureAwait(false);\n        _tableClientProvider.SetTableClient(table);\n    }\n\n    public IJournalStorage CreateStorage(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        return new AzureTableJournalStorage(_shared, journalId);\n    }","sourceCodeStart":21,"sourceCodeEnd":57,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/Azure/Orleans.Journaling.AzureStorage/AzureTableJournalStorageProvider.cs#L21-L57","documentation":"Thrown during AzureTableJournalStorageProvider.Initialize when AzureTableJournalStorageOptions.CreateClient is null, meaning no TableServiceClient was provided. The provider cannot connect to Azure Tables without a client, so it aborts silo initialization rather than failing on the first storage call.","triggerScenarios":"The options were registered (e.g. via AddAzureTableJournaling) but neither TableServiceClient was set nor any ConfigureTableServiceClient overload was called, then the silo lifecycle triggers Initialize.","commonSituations":"Forgetting to call ConfigureTableServiceClient in Program.cs; relying on a config section that did not bind credentials; misordering of configuration such that the client setup callback never ran.","solutions":["Call one of options.ConfigureTableServiceClient(connectionString | Uri | Uri+credential) before startup.","Set options.TableServiceClient directly with a prebuilt TableServiceClient.","Verify your AddAzureTableJournaling configuration lambda actually invokes a ConfigureTableServiceClient overload."],"exampleFix":"// before\nbuilder.AddAzureTableJournaling(opts => { opts.TableName = \"journal\"; });\n// after\nbuilder.AddAzureTableJournaling(opts =>\n{\n    opts.TableName = \"journal\";\n    opts.ConfigureTableServiceClient(builder.Configuration.GetConnectionString(\"AzureStorage\"));\n});","handlingStrategy":"validation","validationCode":"if (options.CreateClient is null && options.TableServiceClient is null)\n    throw new InvalidOperationException(\"Configure a TableServiceClient before startup.\");","typeGuard":"static bool IsTableClientConfigured(AzureTableJournalStorageOptions o) => o.TableServiceClient is not null || o.CreateClient is not null;","tryCatchPattern":null,"preventionTips":["Always call ConfigureTableServiceClient inside your AddAzureTableJournaling lambda.","Add a startup health check that the options have a client configured.","Bind connection strings from a verified configuration source."],"tags":["azure-table-storage","journaling","configuration","startup","client-setup"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}