{"record":{"id":"a10742c92c877bab","repo":"dotnet/orleans","slug":"value-cannot-be-null-parameter-azuresascredenti","errorCode":null,"errorMessage":"Value cannot be null. (Parameter 'azureSasCredential')","messagePattern":"Value cannot be null\\. \\(Parameter 'azureSasCredential'\\)","errorType":"exception","errorClass":"ArgumentNullException","httpStatus":null,"severity":"error","filePath":"src/Azure/Shared/Storage/AzureStorageOperationOptions.cs","lineNumber":148,"sourceCode":"        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()));\n        }\n\n        internal void SetTableServiceClient(Uri serviceUri, TableSharedKeyCredential sharedKeyCredential)\n        {\n            if (serviceUri is null) throw new ArgumentNullException(nameof(serviceUri));\n            if (sharedKeyCredential is null) throw new ArgumentNullException(nameof(sharedKeyCredential));\n            _tableServiceClient = null;\n            CreateClient = () => Task.FromResult(new TableServiceClient(serviceUri, sharedKeyCredential, GetTableClientOptions()));\n        }\n\n        internal TableClientOptions GetTableClientOptions()\n        {\n            var clientOptions = ClientOptions ??= new TableClientOptions();\n            ConfigureRetryOptions(clientOptions.Retry, StoragePolicyOptions);\n            return clientOptions;\n        }","sourceCodeStart":130,"sourceCodeEnd":166,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/Azure/Shared/Storage/AzureStorageOperationOptions.cs#L130-L166","documentation":"Thrown by AzureStorageOperationOptions.SetTableServiceClient(Uri, AzureSasCredential) when the AzureSasCredential is null. The SAS credential carries the signed token; without it authentication is impossible.","triggerScenarios":"Calling ConfigureTableServiceClient(uri, sas) with a valid uri but a null AzureSasCredential — typically the SAS token was never read from config/secrets.","commonSituations":"SAS token not stored in the secret store; expired/rotated token leading to code path that constructs null; misnamed config key.","solutions":["Build a non-null AzureSasCredential from a valid SAS query string, or set TableServiceClient directly.","Read the SAS from a secret manager and validate it is present.","Prefer constructing the client yourself."],"exampleFix":"// before\noptions.ConfigureTableServiceClient(uri, sasCredential); // sasCredential null\n// after\nvar sas = secrets[\"TableSasToken\"] ?? throw new InvalidOperationException(\"Missing TableSasToken\");\noptions.TableServiceClient = new TableServiceClient(uri, new AzureSasCredential(sas));","handlingStrategy":"validation","validationCode":"var sas = secrets[\"TableSasToken\"] ?? throw new InvalidOperationException(\"Missing TableSasToken\");\noptions.TableServiceClient = new TableServiceClient(serviceUri, new AzureSasCredential(sas));","typeGuard":"static bool HasSas(AzureSasCredential? c) => c is not null;","tryCatchPattern":"catch (ArgumentNullException ex) when (ex.ParamName == \"azureSasCredential\") { /* load the SAS token from the secret store */ }","preventionTips":["Store SAS tokens in a secret manager.","Monitor SAS expiry/rotation so the credential is always constructed."],"tags":["orleans","azure-storage","azure-table","configuration","sas","argument"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}