{"record":{"id":"c830f975c19d4c1f","repo":"microsoft/aspire","slug":"aspireradius048","errorCode":"ASPIRERADIUS048","errorMessage":"Secret stores '{existing.Name}' and '{store.Name}' map to the same Bicep identifier '{identifier}' within the same emitted scope. Rename one so they produce distinct identifiers. Diagnostic: ASPIRERADIUS048.","messagePattern":"Secret stores '(.+?)' and '(.+?)' map to the same Bicep identifier '(.+?)' within the same emitted scope\\. Rename one so they produce distinct identifiers\\. Diagnostic: ASPIRERADIUS048\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Aspire.Hosting.Radius/Secrets/RadiusSecretStoreValidation.cs","lineNumber":392,"sourceCode":"            {\n                ThrowDuplicateName(sameEnvironmentCollision, store, identifier);\n            }\n\n            if (appScoped.TryGetValue(identifier, out var applicationCollision))\n            {\n                ThrowDuplicateName(applicationCollision, store, identifier);\n            }\n\n            envScoped[envKey] = store;\n        }\n    }\n\n    private static void ThrowDuplicateName(\n        RadiusSecretStoreResource existing,\n        RadiusSecretStoreResource store,\n        string identifier)\n    {\n        throw new InvalidOperationException(\n            $\"Secret stores '{existing.Name}' and '{store.Name}' map to the same Bicep identifier \" +\n            $\"'{identifier}' within the same emitted scope. Rename one so they produce distinct identifiers. \" +\n            \"Diagnostic: ASPIRERADIUS048.\");\n    }\n}\n","sourceCodeStart":374,"sourceCodeEnd":398,"githubUrl":"https://github.com/microsoft/aspire/blob/25830f84bd145686607ad00c057b3f84e2e51d43/src/Aspire.Hosting.Radius/Secrets/RadiusSecretStoreValidation.cs#L374-L398","documentation":"Thrown for ASPIRERADIUS048 when two secret stores would emit the same Bicep identifier within the same emitted scope, which would produce an invalid/colliding Bicep declaration. Note this is based on the derived Bicep identifier, not necessarily the raw resource name, so distinct C# names can still collide after identifier normalization. The validator (ValidateNoDuplicateNames) detects the collision and reports both store names plus the offending identifier.","triggerScenarios":"Adding two RadiusSecretStoreResources whose names normalize to the same Bicep identifier (e.g. 'My_Store' and 'my-store', or names differing only by characters stripped during identifier sanitization) inside the same scope; re-adding a store with a name that collides with an existing one.","commonSituations":"Loops that add stores with generated names that collide after sanitization; case-insensitive duplicates; renaming conventions where '-' and '_' normalize away; copy-pasting a store registration twice with a minor name tweak that still normalizes identically.","solutions":["Rename one of the two stores so their derived Bicep identifiers differ.","If names come from generated/config data, add a distinguishing prefix or suffix before registration.","Check for duplicate registration of the same logical store (accidental double Add)."],"exampleFix":"// before\nradius.AddSecretStore(\"my-store\", ...);\nradius.AddSecretStore(\"My_Store\", ...); // same Bicep identifier\n\n// after\nradius.AddSecretStore(\"my-store\", ...);\nradius.AddSecretStore(\"my-store-2\", ...);","handlingStrategy":"try-catch","validationCode":"// Normalize names the same way Bicep identifiers are derived and assert uniqueness before adding stores.\nvar ids = stores.Select(NormalizeToBicepIdentifier);\nif (ids.Distinct(StringComparer.Ordinal).Count() != ids.Count()) throw new InvalidOperationException(\"Duplicate Bicep identifiers\");","typeGuard":null,"tryCatchPattern":"try { ValidateSecretStore(store); } catch (InvalidOperationException ex) when (ex.Message.Contains(\"ASPIRERADIUS048\")) { /* rename the colliding store and retry */ }","preventionTips":["Generate store names with globally distinguishing prefixes.","Remember Bicep identifier normalization strips/replaces characters like '-' and '_', and is case-sensitive.","Avoid programmatic loops that add stores from config without uniqueness assertions."],"tags":["radius","secrets","naming-collision","bicep"],"backgroundTag":"invalid-identifier-format","analyzedSha":"25830f84bd145686607ad00c057b3f84e2e51d43","analyzedAt":"2026-09-16T11:10:06.193Z","contentChangedAt":"2026-09-16T11:10:06.193Z","schemaVersion":2},"datasetVersion":"2026-09-21T04:17:39.646Z"}