Edit

Share via


Connect to Office 365 Outlook from workflows in Azure Logic Apps

Applies to: Azure Logic Apps (Consumption + Standard)

This guide shows how to add an Office 365 Outlook trigger or action to your workflow in Azure Logic Apps. You can automate tasks for your Office 365 Outlook account by adding operations from the Office 365 Outlook connector.

For example, your workflow can perform the following tasks:

  • Get, send, and reply to email.
  • Schedule meetings on your calendar.
  • Add and edit contacts.

Note

The Office 365 Outlook connector works only with a work or school account, for example, @fabrikam.onmicrosoft.com. If you have an @outlook.com or @hotmail.com account, use the Outlook.com connector. To connect to Outlook with a different user account, such as a service account, see Connect using other accounts.

Connector technical reference

For information about this connector's operations and any limits, see the connector's reference page.

Prerequisites

Add an Office 365 Outlook trigger

Based on whether you have a Consumption or Standard logic app workflow, follow the corresponding steps:

  1. In the Azure portal, open your Consumption logic app resource.

  2. On the sidebar menu, under Development Tools, select the designer to open your blank workflow.

  3. Add the Office 365 Outlook trigger that suits your scenario by following the general steps to add a trigger to your workflow.

    This example continues with the trigger named When an upcoming event is starting soon. This polling trigger regularly checks for any updated calendar event in your email account, based on the specified schedule.

  4. If prompted, sign in to your Office 365 Outlook account, which creates a connection. To connect with a different user account, such as a service account, see Connect using other accounts.

    Note

    Your connection doesn't expire until revoked, even if you change your sign-in credentials. For more information, see Configurable token lifetimes in Microsoft Entra ID.

  5. In the trigger information box, provide the required information, for example:

    Parameter Required Value Description
    Calendar Id Yes Calendar The calendar to check
    Interval Yes 15 The number of intervals
    Frequency Yes Minute The unit of time

    You can add any other available parameters, such as Time zone, from the Advanced parameters list.

    Screenshot showing the Consumption workflow trigger parameters.

  6. Save your workflow. On the designer toolbar, select Save.

You can now add any other actions that your workflow requires. For example, you can add the Twilio Send message action, which sends a text when a calendar event starts in 15 minutes.

Add an Office 365 Outlook action

Based on whether you have a Consumption or Standard logic app workflow, follow the corresponding steps:

  1. In the Azure portal, open your logic app and workflow in the designer.

    This example continues with the Office 365 Outlook trigger named When a new email arrives.

  2. Add the Office 365 Outlook action that best suits your scenario by following the general steps to add an action to your workflow.

    This example continues with the Office 365 Outlook action named Create contact.

    This operation creates a new contact in Office 365 Outlook. You can use the output from a previous operation in the workflow to create the contact.

  3. If prompted, sign in to your Office 365 Outlook account, which creates a connection. To connect with a different user account, such as a service account, see Connect using other accounts.

    Note

    Your connection doesn't expire until revoked, even if you change your sign-in credentials. For more information, see Configurable token lifetimes in Microsoft Entra ID.

  4. In the trigger information box, provide the required information, for example:

    Parameter Required Value Description
    Folder Id Yes Contacts The folder where the action creates the new contact
    Given name Yes <contact-name> The name to give the contact
    Home phones Yes <home-phone-number> The home phone number for the contact

    This example selects the Contacts folder where the action creates the new contact and uses trigger outputs for the remaining parameter values:

    Screenshot showing the Consumption workflow action parameters.

    You can add any other available parameters from the Advanced parameters list.

  5. Save your workflow. On the designer toolbar, select Save.

Connect using other accounts

If you try connecting to Outlook by using a different account than the one currently signed in to Azure, you might get single sign-on (SSO) errors. This problem happens when you sign in to the Azure portal with one account, but use a different account to create the connection. The designer expects that you use the account that's signed in to the Azure portal. To resolve this problem, you have these options:

  • Set up the other account with the Contributor role in your logic app's resource group.

    1. In the Azure portal, open your logic app's resource group.

    2. On the resource group menu, select Access control (IAM).

    3. Assign the Contributor role to the other account.

      For more information, see Assign Azure roles using the Azure portal.

    4. After you set up this role, sign in to the Azure portal with the account that now has Contributor permissions. You can now use this account to create the connection to Outlook.

  • Set up the other account so that your work or school account has send as permissions.

    If you have admin permissions, on the service account's mailbox, set up your work or school account with either Send as or Send on behalf of permissions. For more information, see Give mailbox permissions to another user - Admin Help. You can then create the connection by using your work or school account. Now, in triggers or actions where you can specify the sender, you can use the service account's email address.

    For example, the Send an email action has an optional parameter, From (Send as), which you can add to the action and use your service account's email address as the sender. To add this parameter, follow these steps:

    1. In the Send an email action, from the Advanced parameters list, select the From (Send as) parameter.

    2. Enter the service account's email address.