{"record":{"id":"dc317d87a52679af","repo":"dotnet/efcore","slug":"the-provisioned-throughput-was-configured-as-manua","errorCode":null,"errorMessage":"The provisioned throughput was configured as manual on '{manualEntityType}', but on '{autoscaleEntityType}' it was configured as autoscale. All entity types mapped to the same container '{container}' must be configured with the same provisioned throughput type.","messagePattern":"The provisioned throughput was configured as manual on '(.+?)', but on '(.+?)' it was configured as autoscale\\. All entity types mapped to the same container '(.+?)' must be configured with the same provisioned throughput type\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/EFCore.Cosmos/Infrastructure/Internal/CosmosModelValidator.cs","lineNumber":307,"sourceCode":"                            throughput.AutoscaleMaxThroughput ?? throughput.Throughput,\n                            conflictingEntityType.DisplayName(),\n                            entityType.DisplayName(),\n                            currentThroughput.AutoscaleMaxThroughput ?? currentThroughput.Throughput,\n                            container));\n                }\n                else if (throughput.AutoscaleMaxThroughput\n                         == null\n                         != (currentThroughput.AutoscaleMaxThroughput == null))\n                {\n                    var conflictingEntityType = mappedTypes.First(et => et.GetThroughput() != null);\n                    var autoscaleType = throughput.AutoscaleMaxThroughput == null\n                        ? entityType\n                        : conflictingEntityType;\n                    var manualType = throughput.AutoscaleMaxThroughput != null\n                        ? entityType\n                        : conflictingEntityType;\n\n                    throw new InvalidOperationException(\n                        CosmosStrings.ThroughputTypeMismatch(manualType.DisplayName(), autoscaleType.DisplayName(), container));\n                }\n            }\n        }\n\n        ValidateContainerIndexing(mappedTypes, container);\n    }\n\n    private static void ValidateContainerIndexing(IReadOnlyList<IEntityType> mappedTypes, string container)\n    {\n        IEntityType? automaticIndexingOwner = null;\n        bool? automaticIndexingEnabled = null;\n        IReadOnlyList<string>? automaticIndexingExceptions = null;\n\n        foreach (var entityType in mappedTypes)\n        {\n            // Only document-root entity types can carry automatic-indexing configuration.\n            // The same setting must apply to every entity type in a shared container.","sourceCodeStart":289,"sourceCodeEnd":325,"githubUrl":"https://github.com/dotnet/efcore/blob/3a2006ef569de08368d59db5e1468aa8f407e4f8/src/EFCore.Cosmos/Infrastructure/Internal/CosmosModelValidator.cs#L289-L325","documentation":"Thrown when one entity type in a shared container configures throughput as MANUAL (HasThroughput with a plain RU value) and another configures it as AUTOSCALE (HasAutoscaleThroughput with an autoscale max). Cosmos requires the entire container to use one throughput mode. The validator detects that one side has AutoscaleMaxThroughput null while the other does not.","triggerScenarios":"Two entity types mapped to the same container where one calls HasThroughput(n) and the other calls HasAutoscaleThroughput(m). Fires during model validation on first model use.","commonSituations":"Switching a workload from manual to autoscale provisioning but only updating one entity's config; merging code branches where one used manual and the other autoscale; misunderstanding that manual-vs-autoscale is a container-wide decision.","solutions":["Decide container-wide whether to use manual or autoscale throughput, then update every entity in that container to use the same mode (HasThroughput for all, or HasAutoscaleThroughput for all).","Prefer autoscale for unpredictable workloads or manual for steady workloads; do not mix.","Centralize the throughput configuration in one place (e.g. a model extension) so it cannot diverge."],"exampleFix":"// before\nmodelBuilder.Entity<A>().ToContainer(\"C\").HasThroughput(400);           // manual\nmodelBuilder.Entity<B>().ToContainer(\"C\").HasAutoscaleThroughput(4000); // autoscale\n\n// after (all autoscale)\nmodelBuilder.Entity<A>().ToContainer(\"C\").HasAutoscaleThroughput(4000);\nmodelBuilder.Entity<B>().ToContainer(\"C\").HasAutoscaleThroughput(4000);","handlingStrategy":"validation","validationCode":"foreach (var g in dbContext.Model.GetEntityTypes().GroupBy(e => e.GetContainer()))\n{\n    bool? autoscale = null;\n    foreach (var e in g)\n    {\n        var t = e.GetThroughput();\n        if (t is null) continue;\n        bool isAuto = t.AutoscaleMaxThroughput != null;\n        if (autoscale is null) autoscale = isAuto;\n        else if (autoscale != isAuto) throw new InvalidOperationException($\"Throughput mode mismatch on {g.Key}\");\n    }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick manual OR autoscale per container and apply it consistently.","Centralize the throughput-mode decision in one extension method.","Validate the model in CI to catch mixed modes."],"tags":["cosmos","model-validation","throughput","autoscale","configuration"],"backgroundTag":null,"analyzedSha":"3a2006ef569de08368d59db5e1468aa8f407e4f8","analyzedAt":"2026-08-11T23:42:04.146Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}