azureblog.co.uk
← cd ~/roles
// roles/entra

Agent ID DeveloperMicrosoft Entra built-in role

Create an agent identity blueprint and its agent identity blueprint principal in a tenant. User will be added as an owner of the created agent identity blueprint and its agent identity blueprint principal.

Role IDadb2368d-a9be-41b5-8667-d96778e081b0
PrivilegedNo
Permissions2

What it can do

PermissionWhat it allows
microsoft.directory/agentIdentityBlueprints/createAsOwnerCreate agent identity blueprints, and creator is added as the first owner
microsoft.directory/servicePrincipals/standard/readRead basic properties of service principals

Assign it

The role ID is the same in every tenant, so these work as they are. Make it eligible through PIM:

powershell13 lines
Connect-MgGraph -Scopes "RoleEligibilitySchedule.ReadWrite.Directory"
$user = Get-MgUser -UserId "jane.doe@contoso.com"
New-MgRoleManagementDirectoryRoleEligibilityScheduleRequest -BodyParameter @{
    Action           = "AdminAssign"
    Justification    = "Needs Agent ID Developer for <reason>"
    RoleDefinitionId = "adb2368d-a9be-41b5-8667-d96778e081b0"
    DirectoryScopeId = "/"
    PrincipalId      = $user.Id
    ScheduleInfo     = @{
        StartDateTime = (Get-Date).ToUniversalTime().ToString("o")
        Expiration    = @{ Type = "afterDuration"; Duration = "P180D" }
    }
}

Who already has it?

powershell3 lines
Connect-MgGraph -Scopes "RoleManagement.Read.Directory"
Get-MgRoleManagementDirectoryRoleAssignment -Filter "roleDefinitionId eq 'adb2368d-a9be-41b5-8667-d96778e081b0'" -ExpandProperty Principal |
    ForEach-Object { $_.Principal.AdditionalProperties.displayName }

Related roles

Find the smallest role for a task →