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)
{
// ...
}
}
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: ! # $ % & ' ( ) * + , - . / : ; < = > ? @ [ ] ^ _ { | } ~.
displayNamestringThe display name shown in the Microsoft Entra admin center.
descriptionstringThe description shown in assignment and consent experiences.
allowedMemberTypesIEnumerable<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.
isEnabledbooloptional 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.
ArgumentExceptionThrown when an argument is invalid.