Deploy a connector to archive Twitter data

This article contains the step-by-step process to deploy a connector that uses the Office 365 Import service to import data from your organization's Twitter account to Microsoft 365. For a high-level overview of this process and a list of prerequisites required to deploy a Twitter connector, see Set up a connector to archive Twitter data .

Tip

If you're not an E5 customer, use the 90-day Microsoft Purview solutions trial to explore how additional Purview capabilities can help your organization manage data security and compliance needs. Start now at the Microsoft Purview trials hub. Learn details about signing up and trial terms.

Step 1: Create an app in Microsoft Entra ID

  1. Go to https://portal.azure.com and sign in using the credentials of a global admin account.

    Sign in to Azure.

  2. In the left navigation pane, select Microsoft Entra ID.

    Go to Microsoft Entra ID.

  3. In the left navigation pane, select App registrations (Preview) and then select New registration.

    Create a new app registration.

  4. Register the application. Under Redirect URI (optional), select Web in the application type dropdown list and then type https://portal.azure.com in the box for the URI.

    Type https://portal.azure.com for the redirect URI.

  5. Copy the Application (client) ID and Directory (tenant) ID and save them to a text file or other safe location. You use these IDs in later steps.

    Copy and save the Application Id and Directory Id.

  6. Go to Certificates & secrets for the new app and under Client secrets select New client secret.

    Create a new client secret.

  7. Create a new secret. In the description box, type the secret and then choose an expiration period.

    Type the secret and choose expiration period.

  8. Copy the value of the secret and save it to a text file or other storage location. This is the Microsoft Entra application secret that you use in later steps.

    Copy and save the secret.

Step 2: Deploy the connector web service from GitHub to your Azure account

  1. Go to this GitHub site and select Deploy to Azure.

    Go to the Azure home page.

  2. After you select Deploy to Azure, you are redirected to an Azure portal with a custom template page. Fill in the Basics and Settings details and then select Purchase.

    Select Create a resource and type storage account.

    • Subscription: Select your Azure subscription that you want to deploy the Twitter connector web service to.
    • Resource group: Choose or create a new resource group. A resource group is a container that holds related resources for an Azure solution.
    • Location: Choose a location.
    • Web App Name: Provide a unique name for the connector web app. Th name must be between 3 and 18 characters in length. This name is used to create the Azure app service URL; for example, if you provide the Web app name of twitterconnector then the Azure app service URL is twitterconnector.azurewebsites.net.
    • tenantId: The tenant ID of your Microsoft 365 organization that you copied after creating the Facebook connector app in Azure Active Directory in Step 1.
    • APISecretKey: You can type any value as the secret. This is used to access the connector web app in Step 5.
  3. After the deployment is successful, the page will look similar to the following screenshot:

    Select Storage and then select Storage account.

Step 3: Create the Twitter app

  1. Go to https://developer.twitter.com, log in using the credentials for the developer account for your organization, and then select Apps.

    Go to https://developer.twitter.com and log in.

  2. Select Create an app.

    Go to Apps page to create an app.

  3. Under App details, add information about the application.

    Enter info about the app.

  4. On the Twitter developer dashboard, select the app that you just created and then select Details.

    Copy and save the App Id.

  5. On the Keys and tokens tab, under Consumer API keys copy both the API Key and the API secret key and save them to a text file or other storage location. Then select Create to generate an access token and access token secret and copy these to a text file or other storage location.

    Copy and save to API secret key.

    Then select Create to generate an access token and an access token secret, and copy these to a text file or other storage location.

  6. Select the Permissions tab and configure the permissions as shown in the following screenshot:

    Configure permissions.

  7. After you save the permission settings, select the App details tab, and then select Edit > Edit details.

    Edit the app details.

  8. Do the following tasks:

    • Select the checkbox to allow the connector app to sign in to Twitter.
    • Add the OAuth redirect Uri using the following format: <connectorserviceuri>/Views/TwitterOAuth, where the value of connectorserviceuri is the Azure app service URL for your organization.

    Allow connector app to sign in to Twitter and add OAuth redirect Uri.

The Twitter developer app is now ready to use.

Step 4: Configure the connector web app

  1. Go to https://<AzureAppResourceName>.azurewebsites.net (where AzureAppResourceName is the name of your Azure app resource that you named in Step 4). For example, if the name is twitterconnector, go to https://twitterconnector.azurewebsites.net. The home page of the app looks like the following screenshot:

    Go to Azure app resource page.

  2. Select Configure to display a sign in page.

    Select Configure to display sign in page.

  3. In the Tenant Id box, type or paste your tenant Id (that you obtained in Step 2). In the password box, type or paste the APISecretKey (that you obtained in Step 2), and then select Set Configuration Settings to display the configuration details page.

    Sign in using tenant Id and API secret key.

  4. Enter the following configuration settings

    • Twitter Api Key: The API key for the Twitter application that you created in Step 3.
    • Twitter Api Secret Key: The API secret key for the Twitter application that you created in Step 3.
    • Twitter Access Token: The access token that you created in Step 3.
    • Twitter Access Token Secret: The access token secret that you created in Step 3.
    • Microsoft Entra Application ID: The application ID for the Microsoft Entra app that you created in Step 1
    • Microsoft Entra Application Secret: The value for the APISecretKey secret that you created in Step 1.
  5. Select Save to save the connector settings.

Step 5: Set up a Twitter connector

Select the appropriate tab for the portal you're using. Depending on your Microsoft 365 plan, the Microsoft Purview compliance portal is retired or will be retired soon.

To learn more about the Microsoft Purview portal, see Microsoft Purview portal. To learn more about the Compliance portal, see Microsoft Purview compliance portal.

  1. Sign into the Microsoft Purview portal.

  2. Select Settings > Data connectors.

  3. Select My connectors, then select Add connector.

  4. From the list, choose Twitter.

  5. On the Terms of service page, select Accept.

  6. On the Add credentials for your connector app page, enter the following information and then select Validate connection.

    • In the Name box, type a name for the connector, such as Twitter help handle.
    • In the Connector URL box, type or paste the Azure app service URL.
    • In the Password box, type or paste the value of the APISecretKey that you created in Step 2.
    • In the Azure App ID box, type or paste the value of the Azure Application App Id (also called the client ID) that you obtained in Step 1.
  7. After the connection is successfully validated, select Next.

  8. On the Authorize Microsoft 365 to import data page, type or paste the APISecretKey again and then select Login web app.

  9. Select Login with Twitter.

  10. On the Twitter sign in page, sign in using the credentials for your organization's Twitter account. After you sign in, the Twitter page displays the following message, "Twitter Connector Job Successfully set up."

  11. Select Continue to complete setting up the Twitter connector.

  12. On the Set filters page, you can apply a filter to initially import items that are a certain age. Select an age, and then select Next.

  13. On the Choose storage location page, type the email address of Microsoft 365 mailbox that the Twitter items are imported to, and then select Next.

  14. Select Next to review the connector settings and then select Finish to complete the connector setup.