withAppRole
Method
interface EntraIdApplicationResource { // ... omitted for brevity withAppRole( value: string, displayName: string, description: string, allowedMemberTypes?: string[], id?: string, isEnabled?: boolean): EntraIdApplicationResource;}Signature
method
withAppRole builderDeclares an application role on a registration created by Aspire.
withAppRole( value: string, displayName: string, description: string, allowedMemberTypes?: string[], id?: string, isEnabled?: boolean): EntraIdApplicationResourceParameters
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.displayName stringThe display name shown in the Microsoft Entra admin center.descriptionstringThe description shown in assignment and consent experiences.allowedMemberTypes string[]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.isEnabled booleanoptionalWhether 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.Returns
EntraIdApplicationResource Applies to
This method applies to the following types: