EntraIdApplicationResource.withAppRole

Method
📦 Aspire.Hosting.Azure.EntraId v17.0.0-preview.1.26567.5
interface EntraIdApplicationResource {
// ... omitted for brevity
withAppRole(
value: string,
displayName: string,
description: string,
allowedMemberTypes?: string[],
id?: string,
isEnabled?: boolean): EntraIdApplicationResource;
}

Signature

methodwithAppRolebuilder
Declares an application role on a registration created by Aspire.
withAppRole(
value: string,
displayName: string,
description: string,
allowedMemberTypes?: string[],
id?: string,
isEnabled?: boolean): EntraIdApplicationResource
valuestringThe value emitted in the roles claim, for example Admin. It must be unique for the application, at most 120 characters, must not start with a period, and may contain only ASCII letters, digits and the punctuation that Microsoft Graph allows.
displayNamestringThe display name shown in the Microsoft Entra admin center.
descriptionstringThe description shown in assignment and consent experiences.
allowedMemberTypesstring[]optionalThe member types the role can be assigned to, passed through to Microsoft Graph (for example User or Application). Defaults to User.
idstringoptionalAn optional role GUID. When omitted, a stable ID is derived from the registration's resource name and value.
isEnabledbooleanoptionalWhether the role is enabled. Defaults to true. To retire a role, deploy it with false and leave it declared; disabling is not access revocation because existing assignments still receive the role in tokens.
EntraIdApplicationResource

Defined on

This method is defined on the following type: