Configuring Applications for the Microsoft Teams SyncPack

Download this manual as a PDF file 

This section describes how to set up the run book automations in SL1 and how to configure the PowerFlow applications in the "Microsoft Teams" SyncPack

Workflow for Configuring the SyncPack

The following workflows describe how to configure Microsoft Teams, SL1, and PowerFlow to work with the "Microsoft Teams" SyncPack.

Configuring Microsoft Teams

  1. See the steps in Configuring Microsoft Teams, below.

Configuring SL1

  1. Create a SOAP/XML credential to access PowerFlow
  2. Edit the Microsoft Teams run book actions
  3. Enable the Microsoft Teams run book automations

Configuring PowerFlow

  1. Create and align a PowerFlow configuration object
  2. Configure the Microsoft Teams PowerFlow applications
  3. Schedule the PowerFlow applications

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 the Microsoft 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". 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.
  2. Create incoming webhooks in Microsoft Teams and ensure the channel privacy setting is "standard" and not "private".
  3. Note the URL of your webhook(s).
  4. Create a bot here (only required fields are needed).
  5. After creating your bot, click My bots from the top menu and select your bot.
  6. Add Microsoft Teams as a featured channel and enable calling.
  7. Create an intermediary URL:
  • In PowerFlow, navigate to the API Keys page ().

  • Click 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>

Configuring SL1

The following topics cover how to set up your SL1 instance to work with the "Microsoft Teams" SyncPack.

Creating a SOAP/XML Credential to Access PowerFlow

You will need to create a SOAP/XML credential so that the action policies included in the "Microsoft Teams Automation" PowerPack can access your PowerFlow system.

The PowerPack includes the "PowerFlow Microsoft Teams" credential, which you can use as a template for the SOAP/XML credential.

To define a SOAP/XML credential using the example credential:

  • In SL1, go to the Credentials page (Manage > Credentials).
  • Click the wrench icon () for the "PowerFlow Microsoft Teams" credential. The Credential Editor modal window appears.
  • Complete the following fields:
  • Name. Type a new name for the credential.
  • All Organizations. Toggle on (blue) to align the credential to all organizations, or toggle off (gray) and then select one or more specific organizations from the What organization manages this service? drop-down field to align the credential with those specific organizations.
  • URL. Type the URL for your PowerFlow system.
  • HTTP Auth User. Type the username for your PowerFlow system.
  • HTTP Auth Password. Type the password for your PowerFlow system.
  1. Click Save & Close.
  2. Take note of the SL1-assigned ID number for the new credential on the Credentials page, in the ID column. You will need the ID number when editing the input parameters of the run book actions included in the PowerPack, below.

Editing the Microsoft Teams Run Book Actions

The "Microsoft Teams AutomationPowerPack includes seven run book actions that use the "Run Integration Service Application" action type to trigger the PowerFlow applications that send and receive data to and from Microsoft Teams. You can specify the credential ID in a JSON structure that you enter in the Input Parameters field in the Action Policy Editor modal.

After you edit the action and trigger the event policy, the new event log will be added to the respective device on the Event Console page.

To edit the actions included in the PowerPack:

  1. In SL1, go to the Actions page (Registry > Run Book > Actions).
  2. Locate the automation action that you want to use, and then click its wrench icon (). The Editing Action page appears.
  3. In the Input Parameters field, change the values of the following parameters:
  • credential_id. Change the value to the credential ID that you noted earlier when creating a credential for your PowerFlow system in the previous procedure. This parameter is required.
  • include_event. Leave the value as "true".
  • application_name. Leave the default application value.
  • params. Leave the default parameter value.
  1. Make sure the Action State is set to Enabled, and then click Save.

Enabling the Microsoft Teams Run Book Automations

The "Microsoft Teams AutomationPowerPack includes seven run book automation policies that you will need to enable.

These policies update the Microsoft Teams alert or SL1 event with the state of the associated event or alert, create a maintenance object, or populates SL1 with on-call details. When the event is first detected in SL1 or Microsoft Teams, the "triggered" state is sent. When the event is acknowledged in SL1 or Microsoft Teams, the "acknowledged" state is sent. When the event is cleared in SL1 or Microsoft Teams, the "resolved" state is sent. When the on-call policy is triggered, on-call details are added to the SL1 event notes. When a maintenance object is required, a maintenance object is created in Microsoft Teams.

The following table shows the automation policy, its aligned events, and the automation action that runs in response to the events.

Automation Policy Name Aligned Events Automation Action
Microsoft Teams: Create Channel

(All Events)

Microsoft Teams: Create Channel
Microsoft Teams: Create Channel Notification - Acknowledge (All Events) Microsoft Teams: Created Channel Notification - Acknowledge
Microsoft Teams: Create Channel Notification - Clear (All Events) Microsoft Teams: Create Channel Notification - Clear
Microsoft Teams: Event Acknowledged

(All Events)

Microsoft Teams: Acknowledge
Microsoft Teams: Event Cleared

(All Events)

Microsoft Teams: Clear
Microsoft Teams: Event Triggered (All Events) Microsoft Teams: Add/Update
Microsoft Teams: Outage Remediation (All Events) Microsoft Teams: Outage Notification

 

To enable the run book automations:

  1. In SL1, go to the Automation page (Registry > Run Book > Automation).
  2. Locate a Microsoft Teams automation policy and click its wrench icon (). The Automation Policy Editor page appears.
  3. Update the following fields:
  • Policy State. Select Enabled.
  • Policy Priority. Select High to ensure that this PowerFlow automation policy is added to the top of the queue.
  • Available Actions. If it is not already selected, select the "Run Integration Service Application: <name>" action that corresponds with the Ansible automation policy you selected in step 2, and click the arrows to move it to Aligned Actions.

ScienceLogic highly recommends that you do not make changes to the Policy Type, Repeat Time, or Align With fields or the And event is NOT acknowledged setting.

  1. Click Save.
  2. Repeat steps 2-4 for the remaining Microsoft Teams run book automation policies.

Configuring PowerFlow

The following topics cover how to set up your PowerFlow instance to work with the "Microsoft Teams" SyncPack.

Creating a Configuration Object

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.

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.
  3. Click Copy as. The Create Configuration pane appears.

  4. Complete the following fields:

  • 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.

  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. 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 create a schedule:

  1. On the Applications page (), click the Schedule button for the application you want to schedule. The Scheduler window appears.
  2. In the Schedule List pane, click the down arrow icon () next to an existing schedule to view the details for that schedule.
  3. In the Schedule Creator pane, complete the following fields for the default Frequency setting:
  • Schedule Name. Type a name for the schedule.
  • 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. To use a cron expression, click the Switch to Cron Expression toggle to turn it blue. 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 Runs app: "Every 0 and 30th minute past every hour on Sat", based on 0,30 in the Minutes field and 6 in the Day of Week field.

  1. Click Save Schedule. The schedule is added to the Schedule List pane. Also, on the Applications page, the Schedule button now displays with a dark blue background:

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 Scheduler window appears.
  2. Click the down arrow icon () to view the details of an existing schedule.
  3. To delete the selected schedule, click the Actions icon () and selectDelete.

On the Scheduler window for a PowerFlow application, you can click the Copy as button from the Schedule List pane to make a copy of an existing schedule.

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.