in src/WebJobs.Extensions.DurableTask/Options/DurableTaskOptions.cs [319:363]
internal void Validate(INameResolver environmentVariableResolver)
{
if (string.IsNullOrEmpty(this.HubName))
{
throw new InvalidOperationException($"A non-empty {nameof(this.HubName)} configuration is required.");
}
if (IsInNonProductionSlot() && this.IsDefaultHubName())
{
throw new InvalidOperationException($"Task Hub name must be specified in host.json when using slots. Specified name must not equal the default HubName ({this.defaultHubName})." +
"See documentation on Task Hubs for information on how to set this: https://docs.microsoft.com/azure/azure-functions/durable/durable-functions-task-hubs");
}
string runtimeLanguage = environmentVariableResolver.Resolve("FUNCTIONS_WORKER_RUNTIME");
if (this.ExtendedSessionsEnabled &&
runtimeLanguage != null && // If we don't know from the environment variable, don't assume customer isn't .NET
!string.Equals(runtimeLanguage, "dotnet", StringComparison.OrdinalIgnoreCase))
{
throw new InvalidOperationException(
"Durable Functions with extendedSessionsEnabled set to 'true' is only supported when using the in-process .NET worker. Please remove the setting or change it to 'false'." +
"See https://docs.microsoft.com/azure/azure-functions/durable/durable-functions-perf-and-scale#extended-sessions for more details.");
}
this.Notifications.Validate();
if (this.MaxConcurrentActivityFunctions <= 0)
{
throw new InvalidOperationException($"{nameof(this.MaxConcurrentActivityFunctions)} must be a positive integer value.");
}
if (this.MaxConcurrentOrchestratorFunctions <= 0)
{
throw new InvalidOperationException($"{nameof(this.MaxConcurrentOrchestratorFunctions)} must be a positive integer value.");
}
if (this.MaxConcurrentEntityFunctions <= 0)
{
throw new InvalidOperationException($"{nameof(this.MaxConcurrentEntityFunctions)} must be a positive integer value.");
}
if (this.MaxEntityOperationBatchSize <= 0)
{
throw new InvalidOperationException($"{nameof(this.MaxEntityOperationBatchSize)} must be a positive integer value.");
}
}