dotnet/orleans · critical · OrleansConfigurationException

No credentials specified. Use the {options.GetType().Name}.C

Error message

No credentials specified. Use the {options.GetType().Name}.ConfigureBlobServiceClient method to configure the Azure Blob Service client.

What it means

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.

Source

Thrown at src/Azure/Orleans.Persistence.AzureStorage/Providers/Storage/AzureBlobStorage.cs:349

            }
        }

        public void Participate(ISiloLifecycle lifecycle)
        {
            lifecycle.Subscribe(OptionFormattingUtilities.Name<AzureBlobGrainStorage>(this.name), this.options.InitStage, Init);
        }

        /// <summary> Initialization function for this storage provider. </summary>
        private async Task Init(CancellationToken ct)
        {
            var stopWatch = Stopwatch.StartNew();

            try
            {
                LogDebugInitializing(this.name, this.options.ContainerName);
                if (options.CreateClient is not { } createClient)
                {
                    throw new OrleansConfigurationException($"No credentials specified. Use the {options.GetType().Name}.{nameof(AzureBlobStorageOptions.ConfigureBlobServiceClient)} method to configure the Azure Blob Service client.");
                }

                var client = await createClient();
                await this.blobContainerFactory.InitializeAsync(client);
                stopWatch.Stop();
                LogInformationInitProvider(this.name, this.GetType().Name, this.options.InitStage, stopWatch.ElapsedMilliseconds);
            }
            catch (Exception ex)
            {
                stopWatch.Stop();
                LogErrorFromInit(ex, this.name, this.GetType().Name, this.options.InitStage, stopWatch.ElapsedMilliseconds);
                throw;
            }
        }

        /// <summary>
        /// Serialize to the configured storage format
        /// </summary>

View on GitHub (pinned to fca799fa70)

Solutions

  1. Call options.ConfigureBlobServiceClient(connectionString) or set options.BlobServiceClient directly inside the AddAzureBlobGrainStorage configuration delegate.
  2. Verify the connection string key in appsettings.json matches the name registered for the storage provider.
  3. If using Managed Identity, call options.ConfigureBlobServiceClient(new Uri(blobEndpoint), new DefaultAzureCredential()).
  4. After fixing, run the Orleans configuration validator (it calls AzureBlobStorageOptionsValidator.ValidateConfiguration) to catch the error earlier at startup.

Example fix

// before
siloBuilder.AddAzureBlobGrainStorage("grainStore", o => { });

// after
siloBuilder.AddAzureBlobGrainStorage("grainStore", o =>
{
    o.ConfigureBlobServiceClient("DefaultEndpointsProtocol=https;AccountName=...;AccountKey=...");
});
Defensive patterns

Strategy: validation

Validate before calling

// Before silo start, verify the options are configured
var options = sp.GetRequiredService<IOptionsMonitor<AzureBlobStorageOptions>>().Get("grainStore");
if (options.CreateClient is null && options.BlobServiceClient is null)
    throw new InvalidOperationException("AzureBlobGrainStorage 'grainStore' has no BlobServiceClient configured.");

Try / catch

// Wrap silo start to surface configuration errors cleanly
try { await host.RunAsync(); }
catch (OrleansConfigurationException ex)
{
    logger.LogCritical(ex, "Orleans configuration failed — check Azure Blob Storage credentials.");
    throw;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of dotnet/orleans@fca799fa70 (2026-08-13). Data as JSON: /api/errors/a07c1e4a2334b1f9. Report an issue: GitHub.