Skip to main content
Version: Latest (Core: 0.57.x, Azure: 0.43.x)

resource-name-pattern

@azure-tools/typespec-azure-resource-manager/resource-name-pattern

Resource names must specify a pattern string using @pattern, providing a regular expression that the name must match.

❌ Incorrect

model Employee is ProxyResource<{}> {
@key("employeeName")
@path
@segment("employees")
name: string;
}

✅ Correct

model Employee is ProxyResource<{}> {
...ResourceNameParameter<Employee>;
}