{"record":{"id":"a07c1e4a2334b1f9","repo":"dotnet/orleans","slug":"no-credentials-specified-use-the-options-gettype","errorCode":null,"errorMessage":"No credentials specified. Use the {options.GetType().Name}.ConfigureBlobServiceClient method to configure the Azure Blob Service client.","messagePattern":"No credentials specified\\. Use the (.+?)\\.ConfigureBlobServiceClient method to configure the Azure Blob Service client\\.","errorType":"exception","errorClass":"OrleansConfigurationException","httpStatus":null,"severity":"critical","filePath":"src/Azure/Orleans.Persistence.AzureStorage/Providers/Storage/AzureBlobStorage.cs","lineNumber":349,"sourceCode":"            }\n        }\n\n        public void Participate(ISiloLifecycle lifecycle)\n        {\n            lifecycle.Subscribe(OptionFormattingUtilities.Name<AzureBlobGrainStorage>(this.name), this.options.InitStage, Init);\n        }\n\n        /// <summary> Initialization function for this storage provider. </summary>\n        private async Task Init(CancellationToken ct)\n        {\n            var stopWatch = Stopwatch.StartNew();\n\n            try\n            {\n                LogDebugInitializing(this.name, this.options.ContainerName);\n                if (options.CreateClient is not { } createClient)\n                {\n                    throw new OrleansConfigurationException($\"No credentials specified. Use the {options.GetType().Name}.{nameof(AzureBlobStorageOptions.ConfigureBlobServiceClient)} method to configure the Azure Blob Service client.\");\n                }\n\n                var client = await createClient();\n                await this.blobContainerFactory.InitializeAsync(client);\n                stopWatch.Stop();\n                LogInformationInitProvider(this.name, this.GetType().Name, this.options.InitStage, stopWatch.ElapsedMilliseconds);\n            }\n            catch (Exception ex)\n            {\n                stopWatch.Stop();\n                LogErrorFromInit(ex, this.name, this.GetType().Name, this.options.InitStage, stopWatch.ElapsedMilliseconds);\n                throw;\n            }\n        }\n\n        /// <summary>\n        /// Serialize to the configured storage format\n        /// </summary>","sourceCodeStart":331,"sourceCodeEnd":367,"githubUrl":"https://github.com/dotnet/orleans/blob/fca799fa70ecb6ad975224271703ca43221f58de/src/Azure/Orleans.Persistence.AzureStorage/Providers/Storage/AzureBlobStorage.cs#L331-L367","documentation":"Thrown by AzureBlobStorage.Init() during silo startup when AzureBlobStorageOptions.CreateClient is null. This means no BlobServiceClient was configured — the provider has no Azure credentials or connection info to talk to Blob Storage. The Init method runs during the grain storage lifecycle initialization stage and cannot proceed without a client factory.","triggerScenarios":"Called when the silo activates the AzureBlobGrainStorage provider at the configured InitStage, and options.CreateClient was never set. This occurs when AddAzureBlobGrainStorage(name, configureOptions => ...) is called without invoking ConfigureBlobServiceClient or setting BlobServiceClient inside the configure delegate.","commonSituations":"Developer adds UseAzureBlobStorageAsDefault() or AddAzureBlobGrainStorage() but forgets to pass the connection string or BlobServiceClient. Missing or misspelled connection string in appsettings.json. Upgrading to a version where ConfigureBlobServiceClient is now [Obsolete] and the new BlobServiceClient property was left unset. Named storage provider registered with a different key than what the connection string section expects.","solutions":["Call options.ConfigureBlobServiceClient(connectionString) or set options.BlobServiceClient directly inside the AddAzureBlobGrainStorage configuration delegate.","Verify the connection string key in appsettings.json matches the name registered for the storage provider.","If using Managed Identity, call options.ConfigureBlobServiceClient(new Uri(blobEndpoint), new DefaultAzureCredential()).","After fixing, run the Orleans configuration validator (it calls AzureBlobStorageOptionsValidator.ValidateConfiguration) to catch the error earlier at startup."],"exampleFix":"// before\nsiloBuilder.AddAzureBlobGrainStorage(\"grainStore\", o => { });\n\n// after\nsiloBuilder.AddAzureBlobGrainStorage(\"grainStore\", o =>\n{\n    o.ConfigureBlobServiceClient(\"DefaultEndpointsProtocol=https;AccountName=...;AccountKey=...\");\n});","handlingStrategy":"validation","validationCode":"// Before silo start, verify the options are configured\nvar options = sp.GetRequiredService<IOptionsMonitor<AzureBlobStorageOptions>>().Get(\"grainStore\");\nif (options.CreateClient is null && options.BlobServiceClient is null)\n    throw new InvalidOperationException(\"AzureBlobGrainStorage 'grainStore' has no BlobServiceClient configured.\");","typeGuard":null,"tryCatchPattern":"// Wrap silo start to surface configuration errors cleanly\ntry { await host.RunAsync(); }\ncatch (OrleansConfigurationException ex)\n{\n    logger.LogCritical(ex, \"Orleans configuration failed — check Azure Blob Storage credentials.\");\n    throw;\n}","preventionTips":["Always provide a configure delegate to AddAzureBlobGrainStorage that sets credentials.","Use IConfiguration.GetConnectionString and validate it is non-null before passing to ConfigureBlobServiceClient.","Run IConfigurationValidator in CI to catch missing credentials before deploy.","Since ConfigureBlobServiceClient is [Obsolete], prefer setting BlobServiceClient directly."],"tags":["azure","blob-storage","configuration","credentials","orleans","startup"],"backgroundTag":null,"analyzedSha":"fca799fa70ecb6ad975224271703ca43221f58de","analyzedAt":"2026-08-13T19:55:57.938Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}