Published:
Dec 1, 2026
|
Last updated:
Dec 1, 2026
|
22
min read

How to Use Microsoft Graph: Reasons, Methods and Best Practices

Christian Buckley
Christian Buckley, a 16-time Microsoft MVP focused on SharePoint, Teams and Copilot for Microsoft 365, is an author, podcaster, Microsoft Regional Director and MGCI Regional Lead. He is known for practical guidance on AI adoption, governance and collaboration strategy.

This article explains when to use Microsoft Graph for sharing links and app access in SharePoint, and when to use the SharePoint REST API to manage role assignments and permission inheritance. It also includes a PowerShell example and access checks.

In this article

Executive summary

For SharePoint item-level access, you need to choose the API based on the access you need. Use Microsoft Graph GET /permissions to inspect visible sharing permissions, but not as a complete effective-access report. Use /invite to grant named people access and /createLink for link-based collaboration.

For apps, use selected permissions and supported POST /permissions operations, with consent, a resource grant and an appropriate token. Use DELETE /permissions/{id} to remove a verified direct sharing permission, then check for other access paths. Choose SharePoint REST for inheritance, classic role assignments and custom permission levels. Use PowerShell for administrator-led scripts or Azure Logic Apps for longer cross-service workflows and automation.

This article guides you through your choices.

When to use Microsoft Graph API for SharePoint item-level access

Use Microsoft Graph when the task fits its sharing model: inspect sharing permissions, give named recipients access, create a sharing link, or grant an application access to selected SharePoint content. Graph is especially useful when access management is one step in a broader Microsoft 365 workflow.

Choose the method based on who or what needs access: /invite for named recipients, /createLink for link-based access, and selected permissions with supported POST /permissions operations for application access. These methods don’t replace classic SharePoint role assignments.

For document libraries, Graph represents files and folders as driveItem resources. Selected application access to list items uses listItem endpoints instead. Also, GET /permissions shows permissions visible to the caller; it isn’t a complete report of everyone who can access the content.

If you need to manage SharePoint inheritance, role assignments, or custom permission levels directly, SharePoint REST is usually the better fit. The following scenarios explain where each approach applies.

Use Microsoft Graph for cross-service workflows

This is where Graph’s unified model becomes especially useful. Rather than treating SharePoint access as an isolated event, a workflow can connect the file, the intended recipient, the surrounding collaboration activity, and the eventual removal of access.

Microsoft Graph is useful when a business process spans several Microsoft 365 services. An application can identify a reviewer, locate a SharePoint file, grant access, notify the reviewer, create a collaboration task, and remove access after the review ends through a consistent identity and API model.

Use Microsoft Graph to inspect file and folder sharing permissions

Before granting or removing access, retrieve the permission collection that is visible to the calling identity. That gives the automation a starting point for validation, while also reminding us that the returned view may not describe every path through which someone can reach the content.

GET /drives/{drive-id}/items/{item-id}/permissions
GET /sites/{site-id}/drive/items/{item-id}/permissions
GET /groups/{group-id}/drive/items/{item-id}/permissions

The information returned depends on the caller. Owners receive all sharing permissions, while non-owner callers receive only permissions that apply to them; properties containing sharing secrets can be further restricted. Although the list-permissions documentation describes inherited results, the permission resource documentation says SharePoint and OneDrive for Business document libraries do not return inheritedFrom. Test in the target tenant and do not treat this endpoint alone as a complete inheritance or effective-access report.

Use Microsoft Graph to share content with known recipients

When the requirement names specific people who should receive access, the invite method maps cleanly to the business action. I still recommend deciding who owns the grant, how long it should last, and how the resulting permission will be verified before sending the request.

POST /sites/{site-id}/drive/items/{item-id}/invite

Use invite when the business action is to give specified recipients access to a file or folder, rather than to create a classic SharePoint role assignment using a specific SharePoint permission level.

Use Microsoft Graph to create governed sharing links

A sharing link is not simply a more convenient version of direct access. It is a distinct access mechanism with its own audience, forwarding, expiration, and revocation considerations.

Before automating link creation, establish the rules that will govern the link throughout its lifecycle.

Use createLink when access should be represented by a sharing link. Define the link type, scope, expiration, recipient restrictions, review process, and revocation method before automating link creation.

Use Microsoft Graph to restrict application access

Microsoft Graph Selected permissions can limit an application’s access through that Selected permission to explicitly assigned resources. The Selected permission grants no access unless Microsoft Entra consent, an assignment on the target resource, and a token containing the Selected scope are all in place. That boundary does not restrict other permissions the application holds: SharePoint honors the permissions in the token. Check that the app does not also have a broader permission, such as Sites.Read.All or Files.ReadWrite.All, that independently grants wider access.

A Selected permission alone does not grant access. The app needs consent to the relevant scope, an explicit permission assignment on the target resource, and a token containing that scope. For delegated access, the app’s and signed-in user’s permissions are intersected; the app cannot exceed the user’s existing access. See Microsoft’s Selected permissions overview.

The available scopes correspond to these SharePoint resource levels:

How Selected scopes align to SharePoint resource levels

Selected scopeResource level
Sites.SelectedSite collection
Lists.SelectedOperations.SelectedList
ListItems.SelectedOperations.SelectedList item, file, or folder
Files.SelectedOperations.SelectedFile or library folder

‍

Assignments below the site-collection level can break permission inheritance and count toward SharePoint’s unique-permission limits. Define ownership, capacity monitoring, periodic review and cleanup before creating them.

A 2026 Politecnico di Torino study, Lost in Permissions: Exploring the Microsoft 365 App Ecosystem, provides broader context: researchers flagged 139 of the 1,069 apps they analyzed as anomalous because their permission profiles differed from similar apps. Anomalous does not necessarily mean over-privileged or unsafe; the study also identified under-privileged apps and apps using uncommon resource-specific permissions. The study is not a measure of Selected-permission adoption.

When to use SharePoint REST instead of Microsoft Graph

Choose SharePoint REST when the requirement is expressed in SharePoint-native security terms: securable objects, inheritance, role definitions, role assignments, or custom permission levels. Start with the required permission model rather than choosing an API first and reshaping the requirement around it.

If the requirement depends on inheritance, permission levels, or classic role assignments, SharePoint REST usually provides the clearer mapping.

Use the SharePoint REST API when the requirement depends on native SharePoint inheritance, role definitions, role assignments, or custom permission levels.

Microsoft Graph vs SharePoint REST: Which API fits each permission task

RequirementMicrosoft GraphSharePoint REST
List sharing permissions on a fileStrong fitPossible through native objects
Invite a recipientStrong fitNot the primary sharing abstraction
Create a sharing linkStrong fitAvailable through SharePoint sharing APIs
Restrict an app to selected contentStrong fitAlso supports selected patterns
Break or reset inheritanceNot the primary Graph modelStrong fit
Work with role definitionsLimited fitStrong fit
Assign a custom permission levelLimited fitStrong fit
Manipulate classic role assignmentsLimited fitStrong fit
Build a cross-service workflowStrong fitSharePoint-specific

‍

Choose according to the permission model you need

A useful way to make the choice is to compare the vocabulary of the two models. Graph begins with files, recipients, links, and selected application access, while SharePoint REST begins with securable objects, inheritance, role definitions, and role assignments.

Spot the right API from the words in your requirements

Microsoft Graph commonly usesSharePoint REST commonly uses
site, list, listItemSecurableObject
drive, driveItemHasUniqueRoleAssignments
permission, sharingLinkRoleDefinition
sharingInvitationRoleAssignment
Selected application permissionsbreakroleinheritance and resetroleinheritance

‍

If the design starts with sharing a file, inviting a recipient, creating a link, or restricting an application to selected content, Microsoft Graph is usually the natural choice. If it starts with a SharePoint permission level or inheritance operation, SharePoint REST usually maps more directly. If you need to define those granular roles before automating assignments, see our blog post on ways to create SharePoint custom permission levels.

When to avoid Microsoft Graph for SharePoint file-level permissions

It’s best to avoid Microsoft Graph when you need to manage SharePoint inheritance, classic role assignments, and custom permission levels, or when a group or information-architecture change would solve the access need more cleanly.

Graph’s sharing methods are not substitutes for SharePoint-native security operations. Before creating item-level exceptions, check whether ongoing team access is better handled through group membership or whether a separate site or library would provide a clearer boundary. If you do grant access, define its owner, review or expiry date, revocation method, and evidence trail. Also verify that the required endpoint is available in v1.0; don’t build a production dependency on a beta-only API. Don’t automate file-level grants without a clear review and revocation process.

These five scenarios will help you recognize when Microsoft Graph isn’t the right choice for a SharePoint access requirement, and to choose a more manageable alternative:

1. You need an unsupported SharePoint security operation

Do not force an invitation, sharing link, or selected app permission to represent a requirement fundamentally about SharePoint role assignments and inheritance.

2. Group membership solves the requirement

If an entire team needs ongoing access, a group-membership change may be simpler than file-level grants.

3. Information architecture can remove the exception

A separate library or site may create a clearer boundary when many files require the same audience.

4. The automation has no revocation process

Define the owner, recipient, resource, role, justification, start, expiration, review, revocation, and evidence before granting access.

5. The required endpoint is beta-only

Graph beta APIs are subject to change and are not supported for production applications. Confirm v1.0 availability before creating a production dependency.

How Microsoft Graph represents SharePoint files and permissions

Microsoft Graph represents document libraries as drives, their files and folders as driveItem resources, and sharing grants as permission objects. A permission object describes a Graph sharing permission; it is not necessarily a classic SharePoint role assignment or a complete picture of effective access.

Common resource paths include:

  • Site: /sites/{site-id}
  • Document libraries: /sites/{site-id}/drives
  • File or folder: /sites/{site-id}/drive/items/{item-id}
  • List: /sites/{site-id}/lists/{list-id}
  • List item: /sites/{site-id}/lists/{list-id}/items/{item-id}

A permission object may include an ID, roles, recipient identity, link or invitation details, expiration, and sharing identifiers. The sharing examples in this article use driveItem endpoints. Selected application-access scenarios can also target list items through listItem endpoints.

Knowing how these resources relate helps you choose the right endpoint, and avoid mistaking a Graph sharing permission for a classic role assignment or a full effective-access report.

Microsoft Graph methods for managing SharePoint item-level access

The core methods cover inspection, recipient-based sharing, link creation, application-permission creation, and revocation. Each produces or acts on a permission object, but the identity type, least-privileged Graph permission, validation path, and business meaning differ by method.

The following comparison provides a practical starting point for selecting the appropriate operation.

Microsoft Graph Methods, their primary use, result, and best fit for specific tasks

MethodPrimary useResultBest fit
GET /permissionsInspect sharing accessPermission collectionReporting and validation
POST /inviteGive recipients accessRecipient sharing permissionKnown users or guests
POST /createLinkCreate link accessSharing-link permissionLink-based collaboration
POST /permissionsCreate supported permission typesApplication permission objectSelected application access where supported
DELETE /permissions/{id}Remove a permissionPermission removedRevocation and cleanup

‍

How to list SharePoint file permissions with Microsoft Graph

When troubleshooting or validating access, listing permissions is usually my first step. It provides the permission IDs and visible sharing details needed for later inspection or cleanup.

Keep in mind that the result reflects the caller context, so it should be treated as evidence from one view of the access model rather than an automatic effective-access report.

GET https://graph.microsoft.com/v1.0/sites/{site-id}/drive/items/{item-id}/permissions?$select=id,roles,grantedToV2,grantedToIdentitiesV2,link,invitation,expirationDateTime
Authorization: Bearer {access-token}
Accept: application/json

Use $select to limit the response to the fields needed for validation and revocation: id, roles, recipient identities, link or invitation details, and expirationDateTime.

Use returned permission IDs for later retrieval, validation, or revocation. Microsoft documents Files.Read as the least-privileged work-or-school delegated permission for listing. For application access, choose the least-privileged permission model supported by the exact endpoint and resource boundary: use an applicable selected scope when supported, or Files.Read.All only when broader application access is justified. Do not infer complete effective access from a single caller view. A full investigation may also require SharePoint groups, Microsoft 365 groups, Entra groups, inherited role assignments, ownership, links, and selected application permissions.

Microsoft 365 Copilot respects existing SharePoint permissions, but it can make content a user is already permitted to access easier to find. A script that checks only Microsoft Graph’s GET /permissions endpoint cannot, on its own, determine whether a library’s permissions are appropriate for Copilot use. This matters because unintended access can expose sensitive content through Copilot: according to CoreView’s 2026 State of Microsoft 365 Security Report snapshot, 66% of organizations have delayed or cancelled a Microsoft 365 Copilot deployment.

How to grant direct access with the Microsoft Graph invite method

Use the invite method when the workflow needs to grant a defined role to identified recipients. The request should also reflect the intended user experience, including whether Graph sends the invitation or another part of the process handles communication.

The request grants read access to one existing recipient without sending a separate invitation message. A successful response returns a collection of permission objects; capture the returned permission ID for validation and later revocation. If you submit multiple recipients, inspect each result and handle 207 Multi-Status as a partial outcome.

POST https://graph.microsoft.com/v1.0/sites/{site-id}/drive/items/{item-id}/invite
Authorization: Bearer {access-token}
Content-Type: application/json

{
    "recipients": [{"email": "reviewer@contoso.com"}],
    "message": "Access granted for document review.",
    "requireSignIn": true,
    "sendInvitation": false,
    "roles": ["read"]
}

Use sendInvitation according to the required experience. Microsoft documents Files.ReadWrite as the least-privileged work-or-school delegated permission and Files.ReadWrite.All as the least-privileged application permission for this operation; Sites.ReadWrite.All is a higher-privileged alternative.

A word of warning, Files.ReadWrite.All grants tenant-wide file access, be very careful when automating app-only /invite requests. Researchers in Lost in Permissions: Exploring the Microsoft 365 App Ecosystem highlighted Files.ReadWrite.All as a prime example of a functionally plausible scope that dramatically expands an organization’s attack surface when granted to an app.

Guest limitation
New guests cannot be invited using app-only access through this method. Existing guests can be invited through app-only requests. For multiple recipients, handle 207 Multi-Status by recording and validating each recipient result separately before retrying only failures.

How to create a SharePoint sharing link with Microsoft Graph

Use createLink when link-based collaboration is the intended outcome, not merely because a link is easy to distribute. Before issuing the request, define the audience, access level, forwarding expectations, expiration and revocation path. Untracked links can make it harder to review and manage access later.

The following request asks for an organization-wide, view-only link with an expiration date. Anyone signed into the organization who receives the link can use it to access the item, so use this scope only when that audience is appropriate.

POST https://graph.microsoft.com/v1.0/sites/{site-id}/drive/items/{item-id}/createLink
Authorization: Bearer {access-token}
Content-Type: application/json

{
    "type": "view",
    "scope": "organization",
    "expirationDateTime": "2027-12-31T23:59:59Z"
}
NOTE: Replace the example date with an appropriate future UTC date and time for your scenario.

After the request, record whether Graph returned 201 Created for a new link or 200 OK for an existing link. Store the returned permission ID and check the returned link’s scope, role and expiration against your requirements. In particular, don’t assume a request for a new expiration changed an existing link.

If you omit scope, the organization’s default link type applies. Treat retainInheritedPermissions: false as an explicit security change: Microsoft says it removes existing permissions when the item is shared for the first time. Plan for review and, when needed, revocation using the stored permission ID.

How to manage selected application access to SharePoint items

Selected permissions are a strong least-privilege pattern for applications because consent and resource access are separate decisions. Granting the selected scope establishes what the application may request, while the resource-level assignment determines where it can actually operate.

A complete implementation therefore includes each of the following steps.

Selected application permissions answer which SharePoint resources an application may access. They do not primarily determine which employee should open a file.

  1. Consent the application to the appropriate delegated or application selected scope in Microsoft Entra ID.
  2. Create an explicit permission assignment on the selected resource using the endpoint documented for that resource.
  3. Acquire a valid token containing the selected scope and test the intended operation.

Selected permissions support least privilege because consent alone grants no resource access. To extend that model beyond SharePoint apps to user accounts and admin roles, read our in-depth post on implementing least-privilege access in M365.

Record the application ID, selected scope, resource ID, assigned role, permission ID, grant owner, review date, and revocation method. For list, list-item, folder, or file grants, monitor the effect on inheritance and unique-permission capacity.

Do not confuse the models
Selected scopes govern application access. Use SharePoint groups, user sharing, and role assignments to govern employee collaboration.

Using the direct POST /permissions method

In SharePoint Online and OneDrive for work or school, POST /driveItem/permissions creates an application permission on a driveItem. It is not a general-purpose replacement for invitations or classic SharePoint ACL operations; use /invite to create new user permissions.

Use the Microsoft Graph v1.0 endpoint and identify the target application in grantedToV2. The request does not accept deprecated identity fields or grantedToIdentitiesV2. Check that the permissions used by the caller are sufficient to create the grant.

Creating the grant is only one part of the process. To use a Selected permission, the application also needs the appropriate consent and a valid token containing that permission.

When testing access, the response can provide a clue about what to check. In an example using Graph Explorer, CoreView Microsoft 365 and Azure subject matter expert Vasil Michev granted an application access to one file in OneDrive for Business, then tested access using delegated permissions.

He explains: “A 403 and a 404 can point to different issues. In this example, without the required Files.SelectedOperations.Selected permission, an attempt to access the file returns a 403. Once that permission is granted, the application can access the file covered by the grant. But if it tries to access another file outside that grant, it receives a 404.”

Vasil says the same distinction applies to Microsoft Graph v1.0. These responses are diagnostic clues, not definitive diagnoses: other issues can also produce a 403 or 404.

Production guidance
Use /invite for user permissions, /createLink for link-based access, and v1.0 POST /permissions for supported application-permission creation. Do not present POST /permissions as a way to assign arbitrary SharePoint permission levels.

How to delete a Microsoft Graph sharing permission

Deleting a permission removes that specific grant; a 204 No Content response does not prove that the user or application has no other access to the item. Store the permission ID when your workflow creates a grant so you can target that grant for revocation later.

Microsoft Graph’s delete operation applies to permissions that are not inherited:

DELETE https://graph.microsoft.com/v1.0/sites/{site-id}/drive/items/{item-id}/permissions/{permission-id}
Authorization: Bearer {access-token}

SharePoint and OneDrive for Business document libraries do not return inheritedFrom in the Permission resource. So, in those libraries, a missing inheritedFrom value does not establish that a permission is direct. Delete the permission ID your workflow created, or one you have otherwise verified is a direct, non-inherited sharing permission. A successful 204 No Content confirms the delete request succeeded; check separately whether the grant is still returned.

What you can verify after deletion

Who performs the check matters. An owner or another caller with sufficient permissions can make another request to /permissions. Microsoft documents that owners see all sharing permissions, while non-owners see only permissions that apply to them.

Vasil adds some additional insight: “If you’re the owner, or otherwise have sufficient permissions, make another call to /permissions. An app with only Selected permissions can’t enumerate permissions or perform broader permission checks. It can make a direct call to a known item to test its own access, but that isn’t a broader audit.”

Use the permissions list to check whether the deleted permission ID is still returned, but don’t treat that check alone as proof that a particular user or app has no other access. Access may remain through another direct permission, group membership, a sharing link, an inherited SharePoint assignment or, for an app, a separate tenant-wide permission such as Sites.Read.All. An app’s direct call tests that app’s access to the known item; it does not verify a human recipient’s access or audit every access path.

For a reproducible revocation check, record the resource and permission IDs, the caller identity, the delete response, who performed the follow-up check, its result and the time of revocation.

How to use Microsoft Graph PowerShell SDK

End-to-end delegated example: grant, verify, and revoke access

This walkthrough uses delegated access through a signed-in administrator or operator. It has been checked against the Microsoft Graph v1.0 documentation but has not been execution-tested. Before publication, replace the placeholders and run the complete grant, verification, and revocation sequence in a non-production tenant; record the SDK version, operator identity, consented scope, target resource, response, returned permission ID, effective-access check, and cleanup result. The operator must already have access to the target item. The example requests Files.ReadWrite because it grants and removes access; use broader scopes only when the documented endpoint and operating model require them. [CHECK BEFORE PUBLISHING: this paragraph contains a pre-publication note from the Word doc (“Before publication, replace the placeholders and run…”). Confirm with the author or remove.]

Connect-MgGraph -Scopes "Files.ReadWrite"
$siteId = "{site-id}"
$itemId = "{item-id}"
$recipient = "reviewer@contoso.com"
$baseUri = "https://graph.microsoft.com/v1.0/sites/$siteId/drive/items/$itemId"

First retrieve the caller-visible permission collection and save it as the pre-change evidence. Then submit one recipient so the response is unambiguous; if batching recipients, treat a 207 response as a collection of individual outcomes.

$before = Invoke-MgGraphRequest -Method GET -Uri "$baseUri/permissions"
$body = @{
    recipients = @(@{ email = $recipient })
    requireSignIn = $true
    sendInvitation = $false
    roles = @("read")
} | ConvertTo-Json -Depth 5

$grant = Invoke-MgGraphRequest -Method POST -Uri "$baseUri/invite" -Body $body -ContentType "application/json"

Validate the specific recipient, role, and returned permission ID rather than relying only on the HTTP status. Store the permission ID with the resource ID, recipient, role, caller, justification, and expiration or review date.

$permissionId = $grant.value[0].id
$afterGrant = Invoke-MgGraphRequest -Method GET -Uri "$baseUri/permissions"
$verified = $afterGrant.value | Where-Object {
    $_.id -eq $permissionId -and $_.roles -contains "read"
}
if (-not $verified) { throw "The intended permission was not verified." }

For revocation, delete only the stored non-inherited permission ID, retrieve the collection again, and separately test whether another permission, link, group, or inherited assignment still provides access.

Invoke-MgGraphRequest -Method DELETE -Uri "$baseUri/permissions/$permissionId"
$afterDelete = Invoke-MgGraphRequest -Method GET -Uri "$baseUri/permissions"
if ($afterDelete.value.id -contains $permissionId) { throw "The permission remains visible after deletion." }

Log the operation, identity type, consented scopes, site and item IDs, recipient, permission ID, request correlation data, per-recipient outcome, verification result, and revocation result. This example validates the permission object visible to the caller; it does not by itself prove the recipient has no other effective-access path.

For administrator-led automation, the Microsoft Graph PowerShell SDK provides a familiar scripting environment while preserving access to the underlying Graph requests. Decide whether the script runs delegated as a named operator or app-only as a service principal, and document that identity before selecting permissions.

The remaining examples isolate the component operations used in the preceding end-to-end walkthrough. Use that walkthrough when you need a complete sequence that includes validation and revocation.

The Microsoft Graph PowerShell SDK fits administrator-led scripts that already use Graph for identities, groups, sites, and files. The examples use Invoke-MgGraphRequest so the REST endpoint, request body, response, and permission ID remain visible; endpoint-specific cmdlets can be substituted when they expose the same v1.0 operation and required parameters.

Connect with required delegated scopes

Begin by connecting with only the scopes required for the approved operation. For delegated work-or-school access, Microsoft documents Files.Read as least privileged for listing permissions and Files.ReadWrite for invite, createLink, and delete. For app-only calls to those sharing and deletion operations, the documented least-privileged application permission is Files.ReadWrite.All. Selected scopes appear in the permission table for direct application-permission creation, but support must be verified for each exact endpoint rather than assumed across operations.

Connect-MgGraph `
    -Scopes "Files.ReadWrite"

This delegated example uses Files.ReadWrite because it lists, grants, and removes access. If the script only reports permissions, request Files.Read. Do not add Sites.ReadWrite.All unless the endpoint and operating model require that higher privilege. Files.ReadWrite.All is available as both a delegated permission and an application permission. For this signed-in walkthrough, specify the delegated permission; the application permission is for app-only access and is not an additional delegated scope.

List sharing permissions

Retrieve the existing permission collection before making a change so the script can compare the current state with the intended outcome.

$siteId = "{site-id}"
$itemId = "{item-id}"
$uri = "https://graph.microsoft.com/v1.0/sites/$siteId/drive/items/$itemId/permissions"
$response = Invoke-MgGraphRequest -Method GET -Uri $uri
$response.value | Select-Object id, roles, grantedToV2, link, invitation

Invite a recipient

When the recipient and role are approved, construct the request body explicitly so notification behavior and access level remain easy to review.

$body = @{
    recipients = @(@{ email = "reviewer@contoso.com" })
    message = "Access granted for document review."
    requireSignIn = $true
    sendInvitation = $false
    roles = @("read")
} | ConvertTo-Json -Depth 5

Invoke-MgGraphRequest -Method POST `
    -Uri "https://graph.microsoft.com/v1.0/sites/$siteId/drive/items/$itemId/invite" `
    -Body $body -ContentType "application/json"

Remove a permission

Use the stored permission ID for targeted revocation, then retrieve the permission collection again to validate the resulting state.

$permissionId = "{permission-id}"
Invoke-MgGraphRequest -Method DELETE `
    -Uri "https://graph.microsoft.com/v1.0/sites/$siteId/drive/items/$itemId/permissions/$permissionId"

Make scripts safe to rerun

Idempotency matters because administrative scripts are often rerun after partial failures or uncertain outcomes. A safe script should recognize when the desired permission already exists rather than progressively adding more access.

  • Retrieve current permissions before granting access.
  • Determine whether an equivalent permission exists.
  • Check that recipient and role match.
  • Confirm whether access should be renewed or unchanged.
  • Store the returned permission ID.

How to use Microsoft Graph with Azure Logic Apps

Azure Logic Apps fits scenarios in which a permission change participates in a longer-lived integration or cross-service process. Define the calling identity explicitly: prefer a managed identity or another centrally governed application identity, then grant only the permissions required by the chosen Graph operation and resource boundary.

Treat access as a lifecycle: capture the business event, current permission state, approval, grant result, permission ID, per-recipient outcome, verification, expiration, revocation, and final evidence.

  1. Receive a business event.
  2. Locate the SharePoint site and file.
  3. Retrieve current file permissions.
  4. Evaluate an approval or classification rule.
  5. Invite a recipient or create a link.
  6. Store the returned permission ID.
  7. Notify the recipient through another service.
  8. Remove the permission after expiration.
  9. Record the result.

Use a maintained authentication pattern

Authentication is part of the solution design. The workflow identity needs approved Graph permissions, a named owner, credential or managed-identity controls, and a revocation path. Do not assume the Logic App designer’s identity is the runtime identity.

Where a selected application permission supports the exact resource and operation, prefer it over tenant-wide application access. Complete consent, explicit resource assignment, and token acquisition before testing the action.

Treat retries carefully

Configure retries only for transient failures and honor response guidance such as Retry-After. Before retrying a create operation, read the current state and compare the intended recipient, link type, role, application, and resource so the workflow converges on one end state. For invitations returning 207 Multi-Status, branch on each recipient outcome and retry only the failed recipients after validation.

Read current permissions
→ Compare the intended identity, permission type, and role
→ Create only when absent
→ Inspect every recipient result
→ Capture the permission ID and correlation data
→ Re-read and verify the intended state
→ Record success, failure, and retry decisions
→ Schedule review or revocation

When Power Automate is the right implementation surface

Power Automate can participate in Graph-based permission workflows, but it is not automatically the simplest implementation surface. Choose it only after evaluating the available connectors, runtime identity, authentication design, retry behavior, and whether the requirement maps more directly to Microsoft Graph or SharePoint REST.

When the requirement is fundamentally about SharePoint inheritance or role assignments, using SharePoint REST may keep the flow simpler and easier for administrators to support.

Power Automate can call Microsoft Graph with an appropriate connection and authentication design, but the SharePoint Send an HTTP request to SharePoint action naturally targets SharePoint REST. For classic inheritance and role assignments, SharePoint REST may be simpler. Graph becomes compelling for Graph-specific sharing, selected application access, and cross-service workflows.

How to streamline governance of SharePoint item-level permissions at scale

Microsoft Graph can automate specific sharing and application-access operations, but creating or changing a permission is only one part of the work. In a large SharePoint environment, teams also need to identify risky item-level access, determine who owns the content, review whether access is still appropriate, remediate exceptions, and retain evidence of the work.

CoreView Control for SharePoint is designed to help with that governance layer, extending visibility to file and folder permissions and supporting an operational cycle of detecting risks, assigning owners, running reviews, remediating issues, and documenting activity. It complements the technical methods in this article: Graph can help perform a targeted operation, while governance processes help teams manage permission exceptions across a broader SharePoint environment. CoreView helps you manage SharePoint permissions before scaling AI projects.

Ready to get SharePoint item-level permissions under control?

See how CoreView Control for SharePoint helps teams find items with unique permissions, review direct access and sharing links, and restore inheritance when appropriate.
Book a CoreView demo

Get a personalized demo today

Created by M365 experts, for M365 experts.