{"record":{"id":"6a75d1fabd762718","repo":"dotnet/orleans","slug":"value-cannot-be-null-parameter-serviceuri","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'serviceUri')","messagePattern":"Value cannot be null\\. \\(Parameter 'serviceUri'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Azure/Shared/Storage/AzureStorageOperationOptions.cs","lineNumber":132,"sourceCode":"        /// <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        }\n\n        internal void SetTableServiceClient(Uri serviceUri, AzureSasCredential azureSasCredential)\n        {\n            if (serviceUri is null) throw new ArgumentNullException(nameof(serviceUri));\n            if (azureSasCredential is null) throw new ArgumentNullException(nameof(azureSasCredential));\n            _tableServiceClient = null;\n            CreateClient = () => Task.FromResult(new TableServiceClient(serviceUri, azureSasCredential, GetTableClientOptions()));","sourceCodeStart":114,"sourceCodeEnd":150,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/Azure/Shared/Storage/AzureStorageOperationOptions.cs#L114-L150","documentation":"Thrown by AzureStorageOperationOptions.SetTableServiceClient(Uri serviceUri) when the URI is null. This single-argument overload (anonymous/public endpoint) cannot proceed without a target, so the guard fires immediately. Reached via the obsolete ConfigureTableServiceClient(Uri).","triggerScenarios":"Calling ConfigureTableServiceClient(serviceUri) where serviceUri is null — usually because a configured endpoint URL was not present.","commonSituations":"Endpoint URL missing from configuration; wrong key name when reading the table endpoint; environment-specific config not deployed.","solutions":["Supply a non-null absolute table service URI, or set TableServiceClient directly.","Bind and validate the endpoint setting before calling configure.","Prefer constructing the client yourself and assigning TableServiceClient."],"exampleFix":"// before\noptions.ConfigureTableServiceClient(uri);  // uri is null\n// after\nvar uri = new Uri(config[\"TableServiceUrl\"] ?? throw new InvalidOperationException(\"Missing TableServiceUrl\"));\noptions.TableServiceClient = new TableServiceClient(uri);","handlingStrategy":"validation","validationCode":"var uri = optionsUri ?? throw new ArgumentNullException(nameof(optionsUri));\noptions.TableServiceClient = new TableServiceClient(uri);","typeGuard":"static bool IsUriReady(Uri? u) => u is not null && u.IsAbsoluteUri;","tryCatchPattern":"catch (ArgumentNullException ex) when (ex.ParamName == \"serviceUri\") { /* bind and validate the endpoint setting */ }","preventionTips":["Read and validate the table endpoint URL before wiring the client.","Prefer constructing TableServiceClient yourself."],"tags":["orleans","azure-storage","azure-table","configuration","argument"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}