This
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
-
See the steps in Configuring Microsoft Teams, below.
Configuring SL1
- Create a SOAP/XML credential to access PowerFlow
- Edit the Microsoft Teams run book actions
- Enable the Microsoft Teams run book automations
Configuring PowerFlow
- Create and align a PowerFlow configuration object
- Configure the Microsoft Teams PowerFlow applications
- 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:
- Follow the steps in the Microsoft documentation to register your application in Azure Active Directory.
- Note the "app_id(client_id)", "client_secret", and "tenant_id" of your application.
The "client_secret" value of your application will only be visible immediately after creating it, so be sure to copy it somewhere safe before continuing.
- Grant the following scoped permissions to the application:
- Channel.Create
- ChannelMessage.Send
- Channel.ReadBasic.All
- offline_access
- openid
- User.Read
- User.Read.All
- Ensure the following Microsoft Graph permissions are assigned to allow proper functionality of the SyncPack:
API/ Permissions Name | Type | Description | Administrator Consent Needed |
---|---|---|---|
Channel.Create | Application | Create channels | Yes |
ChannelMessage.Read.All | Delegated | Read user channel messages | Yes |
ChannelMessage.Read.All | Application | Read all channel messages | Yes |
ChannelMessage.ReadWrite | Delegated | Read and write user channel messages | Yes |
ChannelMessage.Send | Delegated | Send channel messages | No |
Delegated | View users' email address | No | |
openid | Delegated | Sign users in | No |
profile | Delegated | View users' basic profile | No |
User.Read | Delegated | Sign in and read user profile | No |
User.Read.All | Application | Read all users' full profiles | Yes |
- Ensure the following Power Automate permissions are assigned to allow proper functionality of the SyncPack:
API/ Permissions Name | Type | Description | Administrator Consent Needed |
---|---|---|---|
Activity.Read.All | Delegated | Allow the application to read activities | No |
Flows.Read.All | Delegated | Allow the application to read flows | No |
User | Delegated | Access Microsoft Flow as signed in user | Yes |
Required Licenses and Configuration
The following licenses and access permissions are required in order to configure the workflows necessary for the sync between Microsoft Teams and SL1:
- F3 License (or higher). This is required to enable access to Microsoft Teams, and to create and interact with workflows.
- Power Automate Premium License. This is required for building and automating workflows, such as posting adaptive cards based on webhook events and processing responses.
- Administrator access to the SL1 Administration Portal and Microsoft Teams. This is required to configure and manage workflows across both platforms.
- SL1 Integration/Automation License (if required). Depending on how SL1 is being integrated, specific licensing may be needed for automation or API integration with third-party services like Microsoft Teams.
Additional Configuration Required:
-
Ensure that all required IP addresses are added to the firewall rules and that the rules are enabled to allow communication between the necessary services.
-
The workflow app must be added to Teams or Power Automate, which requires administrator approval. Your admin team should assist with this approval.
Configuring Microsoft Teams Workflows
To configure Microsoft Teams workflows:
- In Microsoft Teams, click the three dots icon on the left navigation bar to access additional apps.
- Click to view the available options for creating and managing workflows.
Creating a Webhook Workflow
- In the Workflows window, search for "Webhook".
- Select the Post to a channel when a webhook request is received template.
- Once selected, an HTTP POST request URL will be generated.
Copy this URL, since it will be used later to send messages to the appropriate Teams channel.
- Click .
Necessary Workflows
Two key workflows have been added to enable the integration between Microsoft Teams and PowerFlow, "Posting Adaptive Cards to a Teams Channel" and "When someone responds to an adaptive card"
Configuring the "Posting Adaptive Cards to a Teams Channel" workflow
The "Posting Adaptive Cards to a Teams Channel" automatically posts an adaptive card to a specific Teams channel when a webhook request is received, providing real-time updates or messages as events occur.
- In the Workflows window, search for "Posting Adaptive Cards to a Teams Channel".
- Select the workflow and follow the prompts given. When done, you will see a confirmation message saying "Workflow added successfully!"
- Click the three dots icon next to the workflow and select Edit to view the flowchart of the workflow's execution and make necessary modifications to the steps.
- Select the appropriate authentication option from the Who can trigger the flow? field:
- Anyone. Publicly accessible; anyone can trigger the flow. Authentication is not required since the URL includes an SAS Token.
- Any user in my tenant. Restricts the flow trigger to users within your organization. Any user within the same tenant can call this webhook.
- Specific users in my tenant. Allows only designated users within your tenant to trigger the flow.
- Under the Send each adaptive card section, enter the following values in the listed fields to ensure that adaptive cards are posted in specific Teams channels with the appropriate actions:
- Team. items('Send_each_adaptive_card')?['tid']
- Channel. items('Send_each_adaptive_card')?['chid']
- Card Type ID. Ensure that the value specified here is the same value used in the "When someone responds to an adaptive card" workflow.
- Click the button in the top right corner.
Configuring the "When someone responds to an adaptive card" workflow
This workflow is triggered when a user takes action on the adaptive card (e.g., Acknowledge, Resolve). The workflow initiates a premium HTTP request to POST response data to PowerFlow, which triggers further automated processes in SL1.
- In the Workflows window, search for "When someone responds to an adaptive card".
- Select the workflow and follow the prompts given. When done, you will see a confirmation message saying "Workflow added successfully!"
- Click the three dots icon next to the workflow and select Edit to view the flowchart of the workflow's execution and make necessary modifications to the steps.
- Under the When someone responds to an adaptive card action, ensure that the value in the Card Type ID field is the same value used in the "Posting Adaptive Cards to a Teams Channel" workflow.
- Click the plus sign icon.
- Click the Actions Tab.
- Select HTTP from the Actions tab.
- Under the HTTP action, supply the following values in the listed fields to ensure that data is properly sent to PowerFlow when a button on the adaptive card is clicked in Teams:
- Method. Select POST.
- URI. Enter the PowerFlow intermediary URL. For more information on generating this URI, see the section on Generating the PowerFlow Intermediary URL.
- Body. Enter addProperty(triggerBody()?['entity']?['cardOutputs'], 'user', triggerBody()?['entity']?['teamsFlowRunContext']?['messagePayload']?['from']?['User']?['Id']).
You must be a PowerAutomate Premium user to configure the HTTP action on the workflow.
- Click the button in the top right corner.
You can design multiple workflows to meet your organization's requirements, allowing seamless integration of multiple PowerFlow and SL1 base environments to deliver notifications to either the same or different channels.
Managing and Editing Workflows
Created or added workflows can me edited, deleted, copied, or run manually by any user who is an owner of the workflow. To manage workflows:
- In Microsoft Teams, click the three dots icon on the left navigation bar to access additional apps.
- Click Manage workflows. and then select
- The following options for managing workflows are available here:
- Locate the workflow you want to manage and click on it.
- At the top of the workflow you will see options to Edit, Share, Delete, Run, and more.
Adding Co-Ownwers to a Workflow
You can grant access to specific workflows by adding users as co-owners. To add a co-owner to a workflow:
- In Microsoft Teams, click the three dots icon on the left navigation bar to access additional apps.
- Click Manage workflows. and then select
- Locate the workflow you want to add a co-owner to, click the three dot icon next to it, and select Share.
- In the Co-owners section, type the email address of the user or group you want to add as a co-owner and select the appropriate result from the drop-down menu.
- The added user will now have full control over the workflow, including the ability to edit, delete, or manage the run history of the workflow.
Retrieving the Team ID and Channel ID from a Team
When setting up the configuration object in PowerFlow to enable syncing between Microsoft Teams and SL1, you will need to supply the team_id and channel_id so that the event notification is posted to the right place in Teams. You must retrieve these values from Teams before setting up the configuration object in PowerFlow. To retrieve these values:
-
In Microsoft Teams, select Teams from the navigation menu on the left.
-
Click on the three dots icon to the right of the team name you want to retrieve the "team_id" value from.
-
Click Get link to team.
-
Copy the URL in the window that appears and paste into a text editor. For example, https://teams.microsoft.com/l/team/19%3Ad2a0d920c47f4b4e9b82a61218deed0d%40thread.tacv2/conversations?groupId=b21c662a-e8a2-489f-a78d-a2771d478e0f&tenantId=4df927fc-2cb7-4222-a6a5-c12dab55b4a6
-
To separate out the team_id value, copy the part of the url from groupId to &. Using the example above, the "team_id" would be b21c662a-e8a2-489f-a78d-a2771d478e0f.
-
In Microsoft Teams, find the channel you want to retrieve the "channel_id" value from.
-
Click on the three dots icon to the right of the channel name.
-
Click Get link to channel.
-
Copy the url in the window that appears and paste into a text editor. For example, https://teams.microsoft.com/l/channel/19%3Ad2a0d920c47f4b4e9b82a61218deed0d%40thread.tacv2/General?groupId=b21c662a-e8a2-489f-a78d-a2771d478e0f&tenantId=4df927fc-2cb7-4222-a6a5-c12dab55b4a6
-
To separate out the channel_id value, copy the part of the url from channel/ to /. Using the example above, the "channel_id" would be 19%3Ad2a0d920c47f4b4e9b82a61218deed0d%40thread.tacv2.
-
Set aside the values for the "team_id" and "channel_id" to be used when setting up the configuration object in PowerFlow.
Retrieving the Object ID from your Azure Active Directory Application
The Object ID from your Azure Active Directory application is needed when setting up the configuration object in PowerFlow. It is used to populate the "microsoft_user_ids" value. To retrieve the Object ID:
-
Open Azure Active Directory.
-
Select Enterprise applications from the navigation menu on the left.
-
Search for the name of your application.
-
Take note of the Object ID value. This value should be entered in the "microsoft_user_ids" field in PowerFlow.
Generating the PowerFlow Intermediary URL
When configuring the workflow to handle acknowledgment actions in Teams, you will need to generate an Intermediary URL from PowerFlow:
-
Generate an API key in Powerflow. For more information, see Creating and Using API Keys in SL1 PowerFlow in the PowerFlow Platform manual.
-
Insert your PowerFlow IP address and the generated API key into the following URL:
<https://<Your> PF IP Address>/api/v1/applications/sync_event_status_from_teams_to_sl1/run?PF-APIKEY=<API Key>
This URL is crucial for enabling bi-directional sync between Microsoft Teams and SL1, particularly for acknowledgments triggered from adaptive card actions.
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 Automations" 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:
- Profile Name. Type a new name for the credential.
- 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.
- Click .
- 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 Automations" PowerPack includes three 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:
- In SL1, go to the Actions page (Registry > Run Book > Actions).
- Locate the automation action that you want to use, and then click its wrench icon (
). The Editing Action page appears.
- 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. This parameter is required.
- include_event. Leave the value as "true".
- application_name. Leave the default application value.
- params. Leave the default parameter value.
-
Make sure the Action State is set to Enabled, and then click .
Enabling the Microsoft Teams Run Book Automations
The "Microsoft Teams Automations" PowerPack includes three 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 populate 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 |
To enable the run book automation policies:
- In SL1, go to the Automation page (Registry > Run Book > Automation).
- Locate a Microsoft Teams automation policy and click its wrench icon (
). The Automation Policy Editor page appears.
- 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.
- Click .
- 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:
- In the PowerFlow user interface, go to the Configurations page (
).
- Click the Configuration pane appears. button for the "Sample Microsoft Teams Config" configuration object. The
- Click Create Configuration pane appears. . The
- 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.
- 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.
- client_id. The ID of the registered app in Azure Active Directory.
- client_secret. The 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.
- channel_id. Provide the channel ID if you want to enable sending messages to existing channels. Otherwise, this field is optional.
To retrieve the "team_id" and "channel_id" values, see the Retrieving the Team ID and Channel ID from a Team section.
- 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:
- default_ack_user. The email address of 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.
- region. This is used for saving the SL1 user data to cache.
{
"encrypted": false,
name":"microsoft_user_ids",
"value": "dce672e6-c430-43f9-b17e-bfe07e51816d,30127c40-12b3-436b-8523-115d3b814ea9"
}
To retrieve the "microsoft_user_ids" value see the Retrieving the Object ID from your Azure Active Directory Application section.
- Click . You can now align this configuration object with one or more applications.
Updating the Configuration Object to Send Messages to an Existing Team Channel
You can configure the Microsoft Teams SyncPack to send messages to any existing team channel in Microsoft Teams:
-
In the configuration object, enter the channel ID of the existing Microsoft Teams channel where you want to send SL1 event messages in the channel_id field.
-
Toggle on (blue) the enable_existing_channel configuration option. This setting allows the SyncPack to send messages directly to the pre-defined channel instead of creating a new one.
-
Click
. 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 are 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
- Sync Event Status From Teams to SL1
To align the configuration object with the relevant PowerFlow applications:
-
On the Applications page of the PowerFlow user interface, open one of the PowerFlow applications listed above and click (
). The Configurations pane for that application appears.
- 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.
- Click to align that configuration with the application.
- Repeat this process for the other PowerFlow applications.
Using Microsoft Teams to Receive and Respond to Event Messages
When events are created in SL1 and notifications are sent to the Microsoft Teams channel, an adaptive card displays in the Microsoft Teams channel with event details and action buttons to respond to the event. You can respond to an event notification in Microsoft Teams to be updated in SL1 by adding a note, acknowledging the event, or resolving it. Upon taking action on the event from the adaptive card (Acknowledge, Add Note, or Resolve), the selected action is sent to SL1 to update the event status.
Currently, syncing event updates from SL1 to Microsoft Teams is not supported. This is planned as a future enhancement to keep Microsoft Teams updated with the latest event state from SL1.
Responding to Event Messages
When an event is posted in Teams, you can view details of the event, such as the Event ID, Event Severity, and more. You can respond to the event in Teams, to be updated in SL1 by adding a note, acknowledging the event, or resolving it:
- Add Note to SL1 Event: Click this button, type the note you want to add to the event and press Enter. The note will be added to the event in SL1.
- SL1. : Click this button to acknowledge the event in
- SL1. : Click this button to resolve the event in
Configuring Time Zone of Event Messages
By default, Microsoft Teams uses your local time zone. If you want to change the time zone to UTC or any other time zone, see Microsoft Teams' official documentation for instructions on changing the time zone.
SL1 follows a structured format when sending event details to PowerFlow. Below is an example of an event payload generated when an event is created and the MS Teams automation is triggered:
{ "app_name":"create_teams_channel_for_event", "app_vars":{ "event_details":{ "%D":"2025-02-06 11:08:29", "%d":"2025-02-06 11:08:29", "%M":"CRITICAL: test 11", "%N":"Microsoft Teams: Create Channel", "%S":"CRITICAL" }, "team_id":"${config.team_id}", "tenant_id":"${config.tenant_id}" } }
The event_details section contains two key timestamps, both of which are in UTC format by default:
-
%D (First Detected Time). Represents the initial event occurrence.
-
%d (Last Detected Time). Represents the most recent occurrence.
To modify the time zone format from the SL1 side, update the SL1 server time zone settings. For more information on changing the time zone settings, see the SL1 System Administration manual.