Recommended Options for Uploading a Document to SharePoint Online Library , between SharePoint Online CSOM libraries and Microsoft Graph API

Shreenivasa_06 0 Reputation points
2024-05-23T05:23:30.14+00:00

Hello,

I would like to know the Recommended Options between SharePoint Online CSOM libraries and Microsoft Graph API , for Uploading a Document to SharePoint Online Library .(With Modern Authentication)

Newer version of our application uses .NET Core (6.0) and Older version uses .NET Framework 4.72.

Currently we use SharePoint Online CSOM libraries and the Authentication is based on the SharePoint App-Only Principal with Tenant permissions.

Please Refer to    https://video2.skills-academy.com/en-us/sharepoint/dev/solution-guidance/security-apponly-azureacs

The Permission XML should be as follows - giving full control for the Tenant.  

<AppPermissionRequests AllowAppOnlyPolicy="true">

  <AppPermissionRequest Scope=”http://sharepoint/content/tenant” Right="FullControl" />

</AppPermissionRequests>

Our Customers do not want to give  FullControl  permission to Scope = tenant.

Is the Microsoft Graph API  recommended for this Case ? Where the Authentication is based on the App registered in the Azure AD (Microsoft Entra admin center)

We want to use the same solution for both the versions of our application (.NET Core 6.0  and  .NET Framework 4.72.)

We will be uploading Documents to SharePoint Library with different Search data which will be associated with the Uploaded Document (Can be used for Searching / Filtering Documents).

We are also creating or Updating SharePoint List from the .NET Core Application. (or .NET Framework 4.72 application) .

Please advice.

Thanks

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,150 questions
SharePoint Development
SharePoint Development
SharePoint: A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.Development: The process of researching, productizing, and refining new or existing technologies.
2,783 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 33,176 Reputation points Microsoft Vendor
    2024-05-23T08:14:16.27+00:00

    Hi @Shreenivasa_06,

    You can upload files to SharePoint Online using any programming language with Graph API. You could refer to following issue similar with yours

    https://stackoverflow.com/questions/49776955/how-to-upload-a-large-document-in-c-sharp-using-the-microsoft-graph-api-rest-cal


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.