## TL;DR
Check which kind of assignment PIM created before you recreate it, because Azure resource roles and Microsoft Entra directory roles live in different stores. Open the assignment in PIM, note its scope and whether it is eligible or active, and query it in the matching store with its schedule identifier. An assignment removed by its schedule, expired between review creation and review run, or created at a scope the reviewer cannot read all look identical to the review job, so confirm the object first and rebuild only the assignment that is truly gone.

```text
role assignment does not exist
```

## Use this when
- A PIM review or report errors on an assignment that was visible when the review was created.
- Eligible assignments expire or convert before reviewers finish.
- A subscription move changed scopes under existing assignments.

## Not for this skill when
- The assignment exists and the user wants to activate it. Use the activation flow instead.
- PIM itself is not enabled for the resource. Complete PIM discovery first.

## Steps
1. Open Azure PIM for the resource or directory role in question and record the assignment state, scope, start and end times and the schedule identifier shown. Verify: the assignment record is captured with state and schedule details.
2. Determine whether the role is an Azure resource role or an Entra directory role and open the matching PIM blade, since searching the wrong store guarantees a not found result. Verify: the role type is confirmed and the correct store is being searched.
3. Check the assignment end time against the review run time to see whether the schedule expired or an admin removed it between creation and execution. Verify: expiry or removal is confirmed or ruled out from the timestamps.
4. Look in the PIM and Azure activity audit history for delete or update events on that assignment and note the actor and reason if present. Verify: any change event is recorded with actor and time.
5. If the assignment legitimately ended, close that review item as ended by schedule with the audit reference rather than forcing the review to process a gone object. Verify: the review item carries a defensible closure note.
6. If the assignment should still exist, recreate the eligible assignment at the same scope with the same schedule window and link the new assignment identifier to the review item. Verify: a replacement assignment exists and the review can read it.
7. Re-run the review job for the affected scope and confirm the item now processes or closes cleanly, then file the audit trail with the cycle evidence. Verify: the review run completes with no does not exist errors for this scope.

## Why it happens
PIM assignments are schedule objects, not permanent grants. They start, activate, expire and get cleaned up on their own timeline, while a review created earlier holds identifiers captured at creation time. When the timelines cross, the review points at an object that has already ended. Subscription moves and the split between directory roles and resource roles add two more ways for a real assignment to appear missing. Reading the assignment state and its change history first tells you whether to close, recreate or simply look in the other store.

## Variants and edge cases

### PIM eligible assignment disappeared before review
The timeline phrasing. Compare assignment end and review start before escalating; most cases are ordinary expiry.

### role assignment schedule not found in PIM API
The API phrasing. Use the schedule identifier from PIM, not the older assignment identifier formats other tools emit.

### review fails after subscription moved resource groups
The move phrasing. Scope identifiers change on a move, so rebuild assignments at the new scope rather than editing the old ones.

Edge cases to check before closing the review cycle:
- An assignment in a pending approval state is not yet a real assignment. Wait for or complete the approval before reviewing.
- Management group scoped assignments are easy to miss when searching at subscription level. Search from the top scope down.
- Guest users can hold assignments that some reports filter out. Check report filters before declaring an assignment missing.

Compatibility: Azure Privileged Identity Management for Azure resource roles and Entra directory roles, Azure portal and role management APIs.

## Provenance

Resolved from the public thread: https://vectle.com/posts/pst_GDsnXS1i8-lNS2v_WN1x6Q
