{"record":{"id":"3038b94151ce5709","repo":"dotnet/orleans","slug":"value-cannot-be-null-parameter-connectionstring-3038b9","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'connectionString')","messagePattern":"Value cannot be null\\. \\(Parameter 'connectionString'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Azure/Shared/Storage/AzureStorageOperationOptions.cs","lineNumber":125,"sourceCode":"        /// </summary>\n        [Obsolete($\"Set the {nameof(TableServiceClient)} property directly.\")]\n        public void ConfigureTableServiceClient(Uri serviceUri, AzureSasCredential azureSasCredential)\n        {\n            SetTableServiceClient(serviceUri, azureSasCredential);\n        }\n\n        /// <summary>\n        /// Configures the <see cref=\"TableServiceClient\"/> using an authenticated service URI and a <see cref=\"TableSharedKeyCredential\"/>.\n        /// </summary>\n        [Obsolete($\"Set the {nameof(TableServiceClient)} property directly.\")]\n        public void ConfigureTableServiceClient(Uri serviceUri, TableSharedKeyCredential sharedKeyCredential)\n        {\n            SetTableServiceClient(serviceUri, sharedKeyCredential);\n        }\n\n        internal void SetTableServiceClient(string connectionString)\n        {\n            if (string.IsNullOrWhiteSpace(connectionString)) throw new ArgumentNullException(nameof(connectionString));\n            _tableServiceClient = null;\n            CreateClient = () => Task.FromResult(new TableServiceClient(connectionString, GetTableClientOptions()));\n        }\n\n        internal void SetTableServiceClient(Uri serviceUri)\n        {\n            if (serviceUri is null) throw new ArgumentNullException(nameof(serviceUri));\n            _tableServiceClient = null;\n            CreateClient = () => Task.FromResult(new TableServiceClient(serviceUri, GetTableClientOptions()));\n        }\n\n        internal void SetTableServiceClient(Uri serviceUri, TokenCredential tokenCredential)\n        {\n            if (serviceUri is null) throw new ArgumentNullException(nameof(serviceUri));\n            if (tokenCredential is null) throw new ArgumentNullException(nameof(tokenCredential));\n            _tableServiceClient = null;\n            CreateClient = () => Task.FromResult(new TableServiceClient(serviceUri, tokenCredential, GetTableClientOptions()));\n        }","sourceCodeStart":107,"sourceCodeEnd":143,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/Azure/Shared/Storage/AzureStorageOperationOptions.cs#L107-L143","documentation":"Thrown by AzureStorageOperationOptions.SetTableServiceClient(string connectionString) when the connection string is null or whitespace. Internally invoked by the obsolete ConfigureTableServiceClient(string) overload. A blank connection string cannot construct a TableServiceClient, so it is rejected before any Azure call.","triggerScenarios":"Calling ConfigureTableServiceClient(connectionString) with a null/empty string, typically because a configuration key (e.g. \"AzureStorageConnectionString\") was missing from appsettings or environment.","commonSituations":"Missing or renamed connection-string key in appsettings.json / environment variables; secret not loaded in the deployed environment; local dev using placeholder that resolves to empty.","solutions":["Provide a valid Azure Storage connection string (or, preferred, set TableServiceClient directly).","Verify the config key exists and is bound via configuration binding before calling configure.","Fail fast at startup with a clear message if the connection string section is absent."],"exampleFix":"// before\noptions.ConfigureTableServiceClient(config[\"AzureStorageConnectionString\"]); // null if key missing\n// after\nvar cs = config[\"AzureStorageConnectionString\"] ?? throw new InvalidOperationException(\"Missing AzureStorageConnectionString\");\noptions.TableServiceClient = new TableServiceClient(cs);","handlingStrategy":"validation","validationCode":"var cs = config[\"AzureStorageConnectionString\"];\nif (string.IsNullOrWhiteSpace(cs)) throw new InvalidOperationException(\"Missing AzureStorageConnectionString\");\noptions.TableServiceClient = new TableServiceClient(cs);","typeGuard":"static bool HasConnectionString(string? s) => !string.IsNullOrWhiteSpace(s);","tryCatchPattern":"catch (ArgumentNullException ex) when (ex.ParamName == \"connectionString\") { /* verify the config key and secret source */ }","preventionTips":["Validate connection-string presence at startup with a clear message.","Keep connection strings in the secret store, not source.","Prefer setting TableServiceClient directly."],"tags":["orleans","azure-storage","azure-table","configuration","connection-string","argument"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}