private-link-resource-schema
@azure-tools/typespec-azure-resource-manager/private-link-resource-schemaPrivate endpoint connection and private link resource responses must contain the expected properties.
Private endpoint connection GET and list responses and private link resource list responses must contain the properties needed by private link clients. Use the PrivateEndpoints and PrivateLinks templates with the standard ARM models to provide these properties.
If you customize a response, include properties.privateEndpoint and properties.privateLinkServiceConnectionState for private endpoint connections, or properties.groupId, properties.requiredMembers, and properties.requiredZoneNames for private link resources. List responses must contain a value array of these resources. The properties may be optional or inherited.
This rule checks 200 responses for these ARM resource GET operations. It does not require the APIs to exist.
Impact
Section titled “Impact”- Area: API, SDK
Missing properties prevent clients from consistently using private link resources.
The examples assume Widget is an ARM resource, Connection is declared as PrivateEndpointConnectionResource, and Link is declared as PrivateLink.
❌ Incorrect
Section titled “❌ Incorrect”Private endpoint connection
Section titled “Private endpoint connection”This custom response omits the connection state.
alias Connections = PrivateEndpoints<Connection>;
model IncompleteConnection { properties: { privateEndpoint?: Azure.ResourceManager.CommonTypes.PrivateEndpoint; };}
@armResourceOperationsinterface Widgets { getConnection is Connections.Read<Widget, Response = ArmResponse<IncompleteConnection>>;}Private link resource
Section titled “Private link resource”This custom list response omits the required zone names.
alias Links = PrivateLinks<Link>;
model IncompleteLink { properties: { groupId?: string; requiredMembers?: string[]; };}
@armResourceOperationsinterface Widgets { getLink is Links.Read<Widget>; listLinks is Links.ListByParent< Widget, Response = ArmResponse<ResourceListCustomResult<IncompleteLink>> >;}✅ Correct
Section titled “✅ Correct”Private endpoint connection
Section titled “Private endpoint connection”Use the standard response from PrivateEndpoints.
alias Connections = PrivateEndpoints<Connection>;
@armResourceOperationsinterface Widgets { getConnection is Connections.Read<Widget>;}Private link resource
Section titled “Private link resource”Use the standard list response from PrivateLinks.
alias Links = PrivateLinks<Link>;
@armResourceOperationsinterface Widgets { getLink is Links.Read<Widget>; listLinks is Links.ListByParent<Widget>;}LintDiff Equivalent
Section titled “LintDiff Equivalent”This rule corresponds to PrivateEndpointResourceSchemaValidation.
Suppression
Section titled “Suppression”Suppress the rule on the operation only for an intentional compatibility exception approved by an ARM reviewer.