dotnet/orleans · error · InvalidOperationException

Unknown Playground:Storage:Provider value '{storageProvider}

Error message

Unknown Playground:Storage:Provider value '{storageProvider}'. Use 'Azurite' or 'Azure'.

What it means

An InvalidOperationException thrown by the DurableJobsJournaling Aspire AppHost when the configuration value 'Playground:Storage:Provider' is neither 'Azurite' nor 'Azure'. The AppHost uses this switch to decide whether to provision a real Azure StorageAccount (with a specific SKU/Kind) or run the Azurite emulator for local development. An unrecognized value has no provisioning path, so it fails fast.

Source

Thrown at playground/DurableJobsJournaling/DurableJobsJournaling.AppHost/Program.cs:53

var storage = builder.AddAzureStorage("storage");
if (useAzurite)
{
    storage.RunAsEmulator();
}
else if (useAzure)
{
    storage.ConfigureInfrastructure(infrastructure =>
    {
        var storageAccount = infrastructure.GetProvisionableResources().OfType<StorageAccount>().Single();
        storageAccount.Kind = StorageKind.BlockBlobStorage;
        storageAccount.Sku = new StorageSku { Name = StorageSkuName.PremiumLrs };
        storageAccount.AccessTier.ClearValue();
        RemoveUnsupportedPremiumBlobStorageOutputs(infrastructure);
    });
}
else
{
    throw new InvalidOperationException($"Unknown Playground:Storage:Provider value '{storageProvider}'. Use 'Azurite' or 'Azure'.");
}

var blobs = storage.AddBlobs("blobs");
var tableStorage = useAzurite ? storage : builder.AddAzureStorage("clusteringstorage");
if (useAzure && builder.ExecutionContext.IsPublishMode)
{
    storage.ClearDefaultRoleAssignments();
    tableStorage.ClearDefaultRoleAssignments();
}

var tables = tableStorage.AddTables("tables");

var orleans = builder.AddOrleans("cluster")
    .WithClustering(tables);

var storagePrefix = $"run-{DateTimeOffset.UtcNow:yyyyMMdd-HHmmss}";
var silo = builder.AddProject<Projects.DurableJobsJournaling_Silo>("silo")
    .WithReference(orleans)

View on GitHub (pinned to fca799fa70)

Solutions

  1. Set Playground:Storage:Provider to 'Azurite' for local development (no Azure account needed) or 'Azure' for cloud.
  2. Check appsettings.json, the launchSettings.json environment variables, and any user-secrets for the exact spelling/casing of the key.
  3. If you genuinely need a third provider, add a corresponding provisioning branch before the throw.

Example fix

// before (config)
"Playground": { "Storage": { "Provider": "local" } }

// after
"Playground": { "Storage": { "Provider": "Azurite" } }
Defensive patterns

Strategy: validation

Validate before calling

var provider = builder.Configuration["Playground:Storage:Provider"];
if (provider is not ("Azurite" or "Azure"))
    throw new InvalidOperationException($"Unsupported provider '{provider}'. Use 'Azurite' or 'Azure'.");

Prevention

When it happens

Trigger: Launching the AppHost with Playground:Storage:Provider set to a typo, an empty string, or an unsupported token (e.g., 'Local', 'Cosmos', 'Storage'). The two if-branches for useAzurite/useAzure both evaluate false and execution reaches the throw.

Common situations: Misconfigured appsettings.json, a typo in the launch profile / environment variable, or copying the sample with a different config key name. Renaming the key without updating the comparison.

Related errors


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