Microsoft Teams - Send Message
  • 27 Aug 2024
  • 4 Minutes to read
  • Dark
    Light
  • PDF

Microsoft Teams - Send Message

  • Dark
    Light
  • PDF

Article summary

Microsoft Teams - Send Message posts a message to a Microsoft Teams channel for assets that match the results of the selected saved query, and match the Enforcement Action Conditions, if defined, or assets selected on the relevant Asset page.

See Creating Enforcement Sets to learn more about adding Enforcement Actions to Enforcement Sets.

Note:

General Settings

  • Action name - The name of this Enforcement Action. The system sets a default name. You can change the name.
  • Configure Dynamic Values - Toggle on to enter a Dynamic Value statement. See Creating Enforcement Action Dynamic Value Statements to learn more about Dynamic Value statement syntax.

Required Fields

These fields must be configured to run the Enforcement Set.

  • Webhook URL - The incoming Webhook URL that Microsoft Teams generates for sending messages to a channel. See Generating the Microsoft Teams Incoming Webhook URL below on how to generate and add an incoming Webhook URL to a Microsoft Teams channel.
  • Title - A title for the message. If you do not give a title, the title will be Send Microsoft Teams Message + 'for Query:' + [query name].

Additional Fields

  • Subtitle - A title for the message. If you do not give a title, the title will be Send Microsoft Teams Message + 'for Query:' + [query name].

  • Message Body - The body of the Microsoft Teams message. If you do not supply a body, this field remains empty. Select how to use the text entered in the Message Body field.

    • Prepend Message Body - Adds the entered text before the default message.
    • Replace Message Body - Replaces the default message with the entered text.
    • Append Message Body - Add the entered text after the default message.
  • Create list of predefined responses - This field is only available in an action that is added to a Workflow. Enter a list of response buttons to be shown in the Microsoft Teams message in the order that they are added into this field. Click Add to add each possible response to the list. When a response button is clicked in a Microsoft Teams message that is sent, the workflow continues based on that button.

  • Verify SSL - Select whether to verify the SSL certificate of the server against the CA database inside of Axonius. For more details, see SSL Trust & CA Settings.

  • HTTPS Proxy - Connect the value supplied in Webhook URL to a proxy instead of directly connecting it to the value supplied in Webhook URL.

Generating the Microsoft Teams Incoming Webhook URL

To add an incoming webhook to a Microsoft Teams channel and acquire the correct webhook URL:

  1. Sign into teams.microsoft.com with a user that has permissions to the channel you want to use for notifications.

  2. From the left hand menu, click View more apps and select Workflows.

  3. Select + New flow.

  4. In the Create tab, from the Templates menu, select the tile of Post to a channel when a webhook request is received.


    Teams-1

  5. In the Create a flow dialog for the selected template, enter a Flow name and click Next.

  6. Select a Microsoft Teams Team and a Microsoft Teams Channel.

  7. Click Create flow.

  8. A message appears notifying you that your workflow was created. Click Done.

  9. The URL is generated. Click the copy icon to copy the URL and then click Done again.
    Teams-2

  10. Paste the copied URL into the Webhook URL field in this EC action. This is the endpoint URL that you require to send data to Microsoft Teams.

Legacy Webhook Procedure

You can also add a webhook to a Microsoft Teams channel using the following procedure. However, note that this option will be deprecated by Microsoft by the end of 2024.

  1. Sign into teams.microsoft.com with a user that has permissions to the channel you want to use for notifications. You add the incoming webhook to this channel.
  2. In Teams, select Settings > Member permissions > Allow members to create, update, and remove connectors, so that you can add, modify, or delete a connector.
  3. Open the channel, click the 3-dot menu in the upper-right corner, and select Connectors.
  4. In the Connectors dialog that opens, type incoming webhook in the Search bar.
  5. Near Incoming Webhook, click Add, and in the screen that opens, click Add again to install the app.
  6. Near Incoming Webhook, click Configure, and name your webhook with a name, in our case, Axonius. Optionally, click Upload Image to upload a different image.
  7. Click Create.
  8. Your Incoming Webhook named Axonius has been created and it has been integrated with the Microsoft Teams channel you have chosen. The webhook URL is displayed in the box.
  9. Paste the URL into the Webhook URL field in this EC action. This is the endpoint URL that you require to send data to Microsoft Teams.
  10. Click Done. The webhook is now available in the Microsoft Teams channel.

For more details about other Enforcement Actions available, see Action Library.


Was this article helpful?