Azure function store files on Sharepoint team site

Andreas Nef 0 Reputation points
2023-05-10T20:49:30.9066667+00:00

Hi

I'm starting with azure functions and should, as part of the function, store output into a Sharepoint site. How would I go about for doing this?

Best, Andreas

Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
4,679 questions
SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
10,300 questions
{count} votes

2 answers

Sort by: Most helpful
  1. Bruno Lucas 4,426 Reputation points MVP
    2023-05-11T03:43:54.15+00:00

    Hi,

    There is no azure function adapter for SharePoint:

    https://learn.microsoft.com/en-us/azure/azure-functions/functions-triggers-bindings?tabs=csharp

    You can output to SharePoint using code to access the Graph API

    Graph Explorer is handy to create graph queries

    https://developer.microsoft.com/en-us/graph/graph-explorer

    https://learn.microsoft.com/en-us/graph/api/driveitem-put-content?view=graph-rest-1.0&tabs=http

    1 person found this answer helpful.
    0 comments No comments

  2. MuthuKumaranMurugaachari-MSFT 22,276 Reputation points
    2023-05-12T18:04:52.62+00:00

    Andreas Nef Thanks for posting your question in Microsoft Q&A. As mentioned by Bruno Lucas, there are no supported bindings available for SharePoint in Azure Functions. You can use PnP Framework or CSOM to connect to SharePoint and process the output based on your need.

    Here are some references that would be helpful:

    PnP V4 .NET 6 - https://pnp.github.io/pnpcore/demos/Demo.AzureFunction.OutOfProcess.AppOnly/readme.html

    PnP Code samples - https://github.com/pnp/pnpcore/tree/dev/samples

    CSOM discussion thread: Use CSOM instead of PnP core to interact with SharePoint online inside my Azure function, detailed steps: https://learn.microsoft.com/en-us/answers/questions/1167689/what-i-need-to-do-to-replace-pnp-core-services-wit

    Alternatively, if you can use Logic Apps, it has SharePoint connector to connect to SharePoint and manage documents/list items and review known issues and limitations. I hope this helps with your question and let us know if you have any other questions or face issues.


    If you found the answer to your question helpful, please take a moment to mark it as "Yes" for others to benefit from your experience. Or simply add a comment tagging me and would be happy to answer your questions.

    0 comments No comments