Microsoft Teams - Send Direct Message to Assets
  • 12 Feb 2024
  • 5 Minutes to read
  • Dark
    Light
  • PDF

Microsoft Teams - Send Direct Message to Assets

  • Dark
    Light
  • PDF

Article summary

Microsoft Teams - Send Direct Message to Assets sends a direct message in Microsoft Teams to 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.

General Settings

  • Enforcement Set name (required) - The name of the Enforcement Set. A default value is added by Axonius. You can change the name according to your needs.
  • Add description - Click to add a description of the Enforcement Set. It is recommended to describe what the Enforcement Set does.
  • Run action on assets matching following query (required) - Select an asset category and a query. The Enforcement Action will be run on the assets that match the query parameters.
  • Action name (required) - The name of the Main action. A default value is added by Axonius. You can change the name according to your needs.
  • 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.

  • Use adapter connection - Select this option to use the first connected Microsoft Entra ID (Azure AD)​ adapter credentials.
NOTE

To use this option, you must successfully configure an Microsoft Entra ID (Azure AD) adapter connection. Each asset is run using the the connection that fetched the asset.

Required Fields

These fields must be configured to run the Enforcement Set.

  • Custom message - The text of the Microsoft Teams direct message.

Additional Fields

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

Connection Parameters

If Use adapter connection is not enabled, these fields are required. To access the values for these fields, see the Microsoft Entra ID (Azure AD) adapter configuration page.

  • Azure Client ID - The Application ID of the Axonius application.
  • Azure Client Secret - Specify a non-expired key generated from the new client secret.
  • Azure Tenant ID - Microsoft Entra ID (Azure AD) ID.
  • 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.
  • Account Sub Domain - The Microsoft account's sub domain (<sub_domain>.onmicrosoft.com).
  • Username and Password - The credentials for a user account that has the permissions needed to fetch SaaS data.
  • 2FA Secret Key - The secret generated in Microsoft Entra ID (Azure AD) for setting up 2-factor authentication for the Microsoft user.
  • SSO Provider - If your organization uses Microsoft Entra ID (Azure AD) for SSO, you can select this check box.
    For more information, see Connecting your SSO Solution Provider Adapter.
  • Send asset details in message - Select this option to include asset details in the direct message sent by Teams.
  • Send to manager - Select this option to also send the direct message to the relevant manager for that asset.

API

Axonius uses the Azure AI Bot Service API.

Required Permissions

The following Microsoft Graph permissions are required for the action to work:

  • AppCatalog.Read.All
  • TeamsAppInstallation.ReadWriteForUser.All

Required Ports

Axonius must be able to communicate with Microsoft Teams via TCP port 443.

Set Up the EC Action

To set up this EC Action, you need to first configure a new designated bot in Microsoft Teams and then create a new application in Microsoft Teams.

Configure the Bot

  1. Navigate to https://dev.botframework.com/bots/new and create a new bot.
  2. Fill the following fields:
    • Display name - Any name you want for this bot.
    • Bot handle - The Client ID of the Azure application.
    • Messaging endpoint - Copy the "Webhook URL" from the Axonius configuration (Global settings - Workflows Events - Microsoft Teams). This is only necessary if you are using "Create list of predefined responses" configuration in the action.
    • App type - The tenancy type for the Azure app.
    • Paste your app ID below to continue - The Client ID of the Azure application.
    • App Tenant ID - The Azure Tenant ID (if single tenancy mode is selected).
  3. Click Register.

Set Up the App with the Developer Portal

  1. In Microsoft Teams, from the side panel, click Apps.

  2. Using the search bar, search for "developer portal".

  3. From Microsoft Corporation, click Developer Portal.

  4. Click Add (or Open).

  5. In Developer Portal, click Apps.

  6. Click New app.
    Teams_NewApps

  7. Enter a name for the app and click Add.

  8. On the Basic information page, fill the following fields:

    • Short description
    • Long description
    • Developer or company name
    • Website
    • Privacy policy
    • Terms of use
  9. Click Save.

  10. Click App features.

  11. Click Bot.
    Teams_Bot

  12. Select Select an existing bot, and choose the bot you created earlier.

  13. Under "Select the scopes in which people can use this command", select Personal, Team, and Group Chat.
    Teams_Scopes

  14. Click Save.

  15. In Developer Portal, from the top toolbar, click Tools.

  16. Click Bot management.

  17. Click the bot you've created.

  18. Click Channels.

  19. Make sure Microsoft Teams is checked.
    Teams_Channels

  20. Click Save.

Install the New App in Teams Through the Admin Center

After you set up the app there are two potential ways for installing the app. If this process for installing the app through the Teams portal doesn't work, see the next process for installing the app using a downloaded zip file.

  1. In Developer Portal, from the top toolbar, click Apps.
  2. Select the app you created.
  3. On the top-right of the screen, click Publish.
  4. Select Publish to your org.
  5. Click Publish your app
  6. Navigate to Teams App Management.
  7. Search for your app and click on it.
  8. Click Publish.
  9. When prompted, confirm in the pop up.

Install the New App in Teams Through the Developer Portal

  1. In Developer Portal, from the top toolbar, click Apps.
  2. Select the app you created.
  3. On the top-right of the screen, click Publish.
  4. Select Download the app package to download a zip file containing the application.
  5. Navigate to Teams App Management.
  6. On the top right, click Actions.
  7. Click Upload new app.
  8. Click Upload.
  9. Choose the file you downloaded.

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


Was this article helpful?

Changing your password will log you out immediately. Use the new password to log back in.
First name must have atleast 2 characters. Numbers and special characters are not allowed.
Last name must have atleast 1 characters. Numbers and special characters are not allowed.
Enter a valid email
Enter a valid password
Your profile has been successfully updated.