Configuring Applications for the Microsoft Teams SyncPack

Download this manual as a PDF file 

This section describes how to set up the PowerFlow applications for the Microsoft Teams SyncPack.

Configuring Microsoft Teams

To configure Microsoft Teams to work with PowerFlow, you must register an application in Azure Active Directory and perform some configuration steps for that application before using the Microsoft Teams SyncPack. To configure the application:

  1. Follow the steps in Microsoft's documentation to register your application in Azure Active Directory.
  2. Note the "app_id(client_id)", "client_secret", and "tenant_id" of your application.
  3. Grant scoped permissions to the web API, specifically the following:
  • Calls.Initiate.All
  • Call.InitiateGroupCall.All
  • Channel.Create
  • ChannelMessage.Send
  • Channel.ReadBasic.All
  • offline_access
  • openid
  • User.Read
  • User.Read.All
  1. Follow these steps to authorize a user and retrieve the "refresh_token".
  2. If a refresh token is generated before enabling multi-factor authentication (MFA), the same token will not work once MFA is enabled. In this case you must generate a new refresh token once MFA is enabled and update it in your PowerFlow configuration.

  3. Create incoming webhooks in Microsoft Teams and ensure the channel privacy setting is "standard" and not "private".
  4. Note the URL of your webhook(s).
  5. Create a bot here (only required fields are needed).
  6. After creating your bot, click My bots from the top menu and select your bot.
  7. Add Microsoft Teams as a featured channel and enable calling.
  8. Create an intermediary URL:
    • In PowerFlow, navigate to the API Keys page ().
    • Select Create API Key and copy the key once it is generated.
    • Create the following URL, inserting your PowerFlow IP address and API key where indicated, and paste it in to your PowerFlow configuration:

    https://<Your PF IP Address>/api/v1/applications/sync_event_status_from_teams_to_sl1/run?PF-APIKEY=<API Key>

Creating and Aligning a Configuration Object in PowerFlow

A configuration object supplies the login credentials and other required information needed to execute the steps for a PowerFlow application. The Configurations page () of the PowerFlow user interface lists all available configuration objects for that system.

You can create as many configuration objects as you need. A PowerFlow application can only use one configuration object at a time, but you can use (or "align") the same configuration object with multiple applications.

To use this SyncPack, you will need to use an existing configuration object in the PowerFlow user interface or create a new configuration object. Next, you need to align that configuration object to the relevant applications.

Creating a Configuration Object

For this SyncPack, you can make a copy of the "Sample Microsoft Teams Config" configuration object, which is the sample configuration file that was installed with the Microsoft Teams  SyncPack.

The "Sample Microsoft Teams Config" configuration object contains all of the required variables. Simply update the variables from that object to match your SL1 and Microsoft Teams settings.

To create a configuration object based on the "Sample Microsoft Teams Config" configuration object:

  1. In the PowerFlow user interface, go to the Configurations page ().
  2. Click the Edit button for the "Sample Microsoft Teams Config" configuration object. The Configuration pane appears:

An image of the configuration object page.

  1. Click Copy as. The Create Configuration pane appears.

  2. Complete the following fields:

    • Friendly Name. Name of the configuration object that will display on the Configurations page.
    • Description. A brief description of the configuration object.
    • Author. User or organization that created the configuration object.
    • Version. Version of the configuration object.
  1. In the Configuration Data Values fields, update the default variable definitions to match your PowerFlow configuration:

    • sl1_host. The hostname or IP address of the SL1 system the alerts will synchronize to.
    • sl1_user. The username for your SL1 system.
    • sl1_password. The password for your SL1 system.
    • refresh_token. The refresh token you received in Azure Active Directory.
    • client_id. ID of registered app in Azure Active Directory.
    • client_secret. Secret code given for the corresponding app in Azure Active Directory.
    • tenant_id. Tenant ID of the Azure Active Directory.
    • team_id. ID of your team in Microsoft Teams.
    • ms_teams_webhook_url. The URL of the webhook you created in Azure Active Directory.
    • microsoft_user_ids. Microsoft Teams user ID used for group calling. For a group call, enter multiple user IDs in your PowerFlow configuration separated by commas. For example:
    • {

      "encrypted": false,

      name":"microsoft_user_ids",

      "value": "dce672e6-c430-43f9-b17e-bfe07e51816d,30127c40-12b3-436b-8523-115d3b814ea9"

      }

    • default_ack_user. The default user to acknowledge events and alerts.
    • intermediary_url. URL endpoint of the intermediary between Microsoft Teams and PowerFlow for sending user interaction data.
  1. Click Save. You can now align this configuration object with one or more applications.

Aligning a Configuration Object and Configuring PowerFlow Applications

With this SyncPack, any status changes made to an SL1 event is sent to Microsoft Teams to update the corresponding alert. Any status changes to the Microsoft Teams alert are synced back to the corresponding SL1 event. You will need to align the Microsoft Teams applications with the relevant configuration object in PowerFlow, and, if needed, update any other fields on the Configuration pane for the applications.

To run this SyncPack, you must "align" the configuration object to run with the following PowerFlow applications:

  • Create Channel For Event
  • Created Channel Event Notification MS Teams
  • Major Event Notification To MS Teams
  • Outage Event Notification
  • Sync Event Status From Teams to SL1

To align the configuration object with the relevant PowerFlow applications:

  1. On the Applications page of the PowerFlow user interface, open one of the PowerFlow applications listed above and click Configure (). The Configurations pane for that application appears:

    An image of the Configure page.

  1. From the Configurations drop-down, select the configuration object you want to use.

    The values and other parameters that appear in the Configuration pane with a padlock icon () are populated either by the configuration object you aligned with the application or by the Run Book Action. Do not modify these values. If you encounter an error, make sure your Run Book Action is configured properly.

  1. Click Save to align that configuration with the application.
  2. Wait until you see the "App & Config modifications saved" pop-up message before proceeding.
  3. Repeat this process for the other PowerFlow applications.

Scheduling PowerFlow Applications

You can create one or more schedules for a single application in the PowerFlow user interface. When creating each schedule, you can specify the queue and the configuration file for that application.

To schedule an application:

  1. On the Applications page (), click the Schedule button for the application you want to schedule. The Schedule window appears, displaying any existing schedules for that application:

If you set up a schedule using a cron expression, the details of that schedule display in a more readable format in this list. For example, if you set up a cron expression of */4 * * * *, the schedule on this window includes the cron expression along with an explanation of that expression: "Every 0, 4, 8, 12, 16, 20, 24, 28, 32, 36, 40, 44, 48, 52, and 56th minute past every hour".

  1. Select a schedule from the list to view the details for that schedule.
  2. Click the + icon to create a schedule. A blank Schedule window appears:

  1. In the Schedule window, complete the following fields:
  • Schedule Name. Type a name for the schedule.
  • Switch to. Use this toggle to switch between a cron expression and setting the frequency in seconds.
  • Cron expression. Select this option to schedule the application using a cron expression. If you select this option, you can create complicated schedules based on minutes, hours, the day of the month, the month, and the day of the week. As you update the cron expression, the Schedule window displays the results of the expression in more readable language, such as Expression: "Every 0 and 30th minute past every hour on the 1 and 31st of every month", based on */30 * * /30 * *.
  • Frequency in seconds. Type the number of seconds per interval that you want to run the application.
  • Custom Parameters. Type any JSON parameters you want to use for this schedule, such as information about a configuration file or mappings.

  1. Click Save Schedule. The schedule is added to the list of schedules on the initial Schedule window. Also, on the Applications page, the word "Scheduled" appears in the Scheduled column for this application, and the Schedule button contains a check mark:

After you create a schedule, it continues to run until you delete it. Also, you cannot edit an existing schedule, but you can delete it and create a similar schedule if needed.

To view or delete an existing schedule:

  1. On the Applications page, click the Schedule button for the application that contains a schedule you want to delete. The Schedule window appears.

  1. Click the down arrow icon () to view the details of an existing schedule:

  1. To delete the selected schedule, click Delete. The schedule is removed.

When either multiple SL1 instance or multiple Microsoft Teams instances are involved with PowerFlow, you should create an individual configuration object for each SL1 or Microsoft Teams instance. Next, create an individual schedule for each configuration object. Each schedule should use a configuration object that is specific to that single SL1 or Microsoft Teams instance. Creating copies of a PowerFlow application from a SyncPack for the purpose of distinguishing between domains is not supported, and will result in issues on upgrades.