Skip to content

resource-name-pattern

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

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

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

Impacts the API: this corresponds to the LintDiff rule ResourceNameRestriction and causes an RPC violation. Ask the author to use @pattern or the ResourceNameParameter template with a pattern string or union type. Do not accept a suppression unless it is needed to match existing APIs.