arm-custom-resource-no-key
@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-keyValidate that custom resource contains a key property.
@azure-tools/typespec-azure-resource-manager/arm-custom-resource-no-keyCustom Azure resource models must define a key property using the @key decorator, especially if the custom resource will be used in operations. Without a key, operation paths may be duplicated.
Impact
Section titled “Impact”- Area: API, SDK
Mainly a correctness issue: the resource’s name property should be marked with @key.
❌ Incorrect
Section titled “❌ Incorrect”@Azure.ResourceManager.Legacy.customAzureResourcemodel CustomResource { someId: string;}✅ Correct
Section titled “✅ Correct”@Azure.ResourceManager.Legacy.customAzureResourcemodel CustomResource { @key someId: string;}Suppression
Section titled “Suppression”Suppress only when required to match an existing API; otherwise add @key to the name parameter of the resource.