NamingPolicy interface

Strategy for generating Azure resource names when a resource is created without an explicit name.

Implement this interface to provide a custom naming convention. Two built-in implementations are provided:

  • DefaultNamingPolicy — workload-based names with abbreviations, ordinals, and uniqueString() for globally-scoped resources.
  • namingRequiredPolicy — a singleton that throws if a resource doesn't provide an explicit name.

Methods

generateName(NamingContext)

Produces a candidate; resource construction validates the returned name.

Method Details

generateName(NamingContext)

Produces a candidate; resource construction validates the returned name.

function generateName(context: NamingContext): ExpressionOrValue<string>

Parameters

context
NamingContext

Returns