EntraIdAppRole Constructors
ClassConstructors1 member
Describes an application role declared on a Microsoft Entra ID application registration created by Aspire.
Constructor(string, string, string, IEnumerable<string>, Guid?, bool) Section titled Constructor(string, string, string, IEnumerable<string>, Guid?, bool) Initializes a new instance of the
EntraIdAppRole class. public sealed class EntraIdAppRole{ public EntraIdAppRole( string value, string displayName, string description, IEnumerable<string>? allowedMemberTypes = null, Guid? id = null, bool isEnabled = true) { // ... }}Parameters
valuestring The 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 IEnumerable<string> optional The member types the role can be assigned to, passed through to Microsoft Graph (for example User or Application). Defaults to User. idGuid?optional An optional role ID. When omitted, a stable ID is derived from the application's resource name and value. isEnabled booloptional Whether the role is enabled. To retire a role, deploy it with false and leave it declared. A disabled role can't be assigned to anyone new, but Microsoft Entra keeps issuing it in tokens for existing assignments, so disabling is not access revocation; remove existing assignments separately. Microsoft Graph rejects deleting an enabled role, so delete one only after a deployment has disabled it, and only while other roles remain declared. Exceptions
ArgumentExceptionThrown when an argument is invalid.