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
- Set Playground:Storage:Provider to 'Azurite' for local development (no Azure account needed) or 'Azure' for cloud.
- Check appsettings.json, the launchSettings.json environment variables, and any user-secrets for the exact spelling/casing of the key.
- 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
- Document the two valid values in the sample README.
- Fail fast with the allowed values listed (the message already does).
- Use configuration validation (ValidateDataAnnotations or a startup check) to catch typos at launch.
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
- AzureTable:ServiceUri must be an absolute HTTPS Azure Table
- AZURE_CLIENT_ID must contain the user-assigned managed ident
- Configure AzureTable:ServiceUri for Azure, or use Azurite wi
- {key} is not configured.
- The name of invariant must contain characters
AI-assisted analysis of dotnet/orleans@fca799fa70 (2026-08-13).
Data as JSON: /api/errors/f346a626098dd67d.
Report an issue: GitHub.