{"record":{"id":"502a4eb3309274df","repo":"dotnet/efcore","slug":"the-provisioned-throughput-was-configured-to-thr","errorCode":null,"errorMessage":"The provisioned throughput was configured to '{throughput1}' on '{entityType1}', but on '{entityType2}' it was configured to '{throughput2}'. All entity types mapped to the same container '{container}' must be configured with the same provisioned throughput.","messagePattern":"The provisioned throughput was configured to '(.+?)' on '(.+?)', but on '(.+?)' it was configured to '(.+?)'\\. All entity types mapped to the same container '(.+?)' must be configured with the same provisioned throughput\\.","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/EFCore.Cosmos/Infrastructure/Internal/CosmosModelValidator.cs","lineNumber":287,"sourceCode":"                            conflictingEntityType.DisplayName(),\n                            entityType.DisplayName(),\n                            currentDefaultTtl,\n                            container));\n                }\n            }\n\n            var currentThroughput = entityType.GetThroughput();\n            if (currentThroughput != null)\n            {\n                if (throughput == null)\n                {\n                    throughput = currentThroughput;\n                }\n                else if ((throughput.AutoscaleMaxThroughput ?? throughput.Throughput)\n                         != (currentThroughput.AutoscaleMaxThroughput ?? currentThroughput.Throughput))\n                {\n                    var conflictingEntityType = mappedTypes.First(et => et.GetThroughput() != null);\n                    throw new InvalidOperationException(\n                        CosmosStrings.ThroughputMismatch(\n                            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;","sourceCodeStart":269,"sourceCodeEnd":305,"githubUrl":"https://github.com/dotnet/efcore/blob/3a2006ef569de08368d59db5e1468aa8f407e4f8/src/EFCore.Cosmos/Infrastructure/Internal/CosmosModelValidator.cs#L269-L305","documentation":"Thrown when the provisioned throughput VALUE differs across entity types mapped to the same Cosmos container. Throughput (RU/s) is a container-level Cosmos property, so all types sharing the container must declare the same number. The validator compares the effective RU value (autoscale max OR manual throughput) and rejects mismatches in the numeric value.","triggerScenarios":"Two entity types sharing a container both call HasThroughput with different RU values (e.g. 400 vs 1000). Triggered during model validation. Note this specific error covers the value mismatch; a separate error (ThroughputTypeMismatch) covers the manual-vs-autoscale mismatch.","commonSituations":"Each team configures throughput on their own entity without realizing the entities share a container; increasing throughput on one type during load testing but forgetting the sibling; copy-pasting entity configs and editing only one number.","solutions":["Pick the RU/s the whole container needs and call HasThroughput with that value on exactly one entity (typically the root).","Remove HasThroughput calls from every other type mapped to the same container.","If you need different throughput per logical entity, they must live in different containers (ToContainer with different names)."],"exampleFix":"// before\nmodelBuilder.Entity<Account>().ToContainer(\"Items\").HasThroughput(400);\nmodelBuilder.Entity<Profile>().ToContainer(\"Items\").HasThroughput(1000);\n\n// after\nmodelBuilder.Entity<Account>().ToContainer(\"Items\").HasThroughput(1000);\nmodelBuilder.Entity<Profile>().ToContainer(\"Items\");","handlingStrategy":"validation","validationCode":"foreach (var g in dbContext.Model.GetEntityTypes().GroupBy(e => e.GetContainer()))\n{\n    var rus = g.Select(e => e.GetThroughput())\n               .Where(t => t != null)\n               .Select(t => t.AutoscaleMaxThroughput ?? t.Throughput)\n               .Distinct();\n    if (rus.Count() > 1) throw new InvalidOperationException($\"Throughput mismatch on {g.Key}\");\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Set HasThroughput on exactly one entity per container.","Keep a single configuration extension method that applies throughput for a container.","Use different containers (ToContainer) if entities truly need different RU budgets."],"tags":["cosmos","model-validation","throughput","ru","configuration"],"backgroundTag":null,"analyzedSha":"3a2006ef569de08368d59db5e1468aa8f407e4f8","analyzedAt":"2026-08-11T23:42:04.146Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}