Connect to SharePoint resources using Azure Logic Apps

To automate tasks that monitor and manage resources, such as files, folders, lists, and items, in SharePoint Online or in on-premises SharePoint Server, you can create automated integration workflows by using Azure Logic Apps and the SharePoint connector.

The following list describes example tasks that you can automate:

  • Monitor when files or items are created, changed, or deleted.
  • Create, get, update, or delete items.
  • Add, get, or delete attachments. Get the content from attachments.
  • Create, copy, update, or delete files.
  • Update file properties. Get the content, metadata, or properties for a file.
  • List or extract folders.
  • Get lists or list views.
  • Set content approval status.
  • Resolve persons.
  • Send HTTP requests to SharePoint.
  • Get entity values.

In your logic app workflow, you can use a trigger that monitors events in SharePoint and makes the output available to other actions. You can then use actions to perform various tasks in SharePoint. You can also include other actions that use the output from SharePoint actions. For example, if you regularly retrieve files from SharePoint, you can send email alerts about those files and their content by using the Office 365 Outlook connector or Outlook.com connector. If you're new to logic apps, review What is Azure Logic Apps?. Or, try this quickstart to create your first example logic app workflow.

Prerequisites

  • Your Microsoft Office 365 account credentials that you use with SharePoint where you sign in with a work or school account.

    You need these credentials so that you can authorize your workflow to access your SharePoint account.

    Note

    If you're using Microsoft Azure operated by 21Vianet, Azure Active Directory (Azure AD) authentication works only with an account for Microsoft Office 365 operated by 21Vianet (.cn), not .com accounts.

  • Your SharePoint site address

  • An Azure account and subscription. If you don't have an Azure subscription, sign up for a free Azure account.

  • For connections to an on-premises SharePoint server, you need to install and set up the on-premises data gateway on a local computer and a data gateway resource that's already created in Azure.

    You can then select the gateway resource to use when you create the SharePoint Server connection from your workflow.

  • The logic app workflow where you need access to your SharePoint site or server.

    • To start the workflow with a SharePoint trigger, you need a blank logic app workflow.
    • To add a SharePoint action, your workflow needs to already have a trigger.

Connector reference

For more technical details about this connector, such as triggers, actions, and limits as described by the connector's Swagger file, review the connector's reference page.

Connect to SharePoint

When you add a trigger or action that connects to a service or system for the first time, the Logic App Designer prompts you to create a connection by providing the necessary information, which varies based on the connection, for example:

  • The name that you want to use for the new connection

  • The name for the system or server

  • Your user or account credentials

  • The authentication type to use

Add a trigger

  1. From the Azure portal, Visual Studio Code, or Visual Studio, open your logic app workflow in the visual designer, if not open already.

  2. On the designer, in the search box, enter sharepoint as the search term. Select the SharePoint connector.

  3. From the Triggers list, select the trigger that you want to use.

  4. When you are prompted to sign in and create a connection, choose one of the following options:

    • For SharePoint Online, select Sign in and authenticate your user credentials.
    • For SharePoint Server, select Connect via on-premises data gateway. Provide the request information about the gateway resource to use, the authentication type, and other necessary details.
  5. When you're done, select Create.

    After your workflow successfully creates the connection, your selected trigger appears.

  6. Provide the information to set up the trigger and continue building your workflow.

Add an action

  1. From the Azure portal, Visual Studio Code, or Visual Studio, open your logic app workflow in the visual designer, if not open already.

  2. Choose one of the following options:

    • To add an action as the currently last step, select New step.
    • To add an action between steps, move your pointer over the arrow between those steps. Select the plus sign (+), and then select Add an action.
  3. Under Choose an operation, in the search box, enter sharepoint as the search term. Select the SharePoint connector.

  4. From the Actions list, select the action that you want to use.

  5. When you are prompted to sign in and create a connection, choose one of the following options:

    • For SharePoint Online, select Sign in and authenticate your user credentials.
    • For SharePoint Server, select Connect via on-premises data gateway. Provide the request information about the gateway resource to use, the authentication type, and other necessary details.
  6. When you're done, select Create.

    After your workflow successfully creates the connection, your selected action appears.

  7. Provide the information to set up the action and continue building your workflow.

Next steps

Learn about other Logic Apps connectors