Microsoft Teams Bot for A-Ops

In this guide, we will showcase how to create a Teams application that allows A-Ops to interact with Teams through an A-Ops Teams bot.

Download A-Ops Teams application (.zip)

Requirements

  • Teams Integration
  • Administrator access to Microsoft tenancy

Prerequisite Steps:

Before creating the teams bot within Dev Teams in Microsoft, there are a few things need to be done within the A-Ops platform such as creating new user and group for the A-Ops bot to be able to authenticate to the platform.

  1. Navigate to System/ Integrations
  2. On the search Bar search for "Microsoft Teams" and click on Install
  3. Navigate to System / Account Management / Groups and click on Add Group:
    1. Add the name: aops-bot and click Create Group
    2. Edit the new aops-bot Group and navigate to the Roles tab
    3. On the Role section, enter: cluster.messages.trigger and press Add
    4. Navigate to the Group section and press save.
  4. Navigate to System / Account Management / Users and click on Add User:
    1. Name: aops-bot
    2. Username: aops-bot@ (This can be retrieved from your URL bar: https://prod-eu-west-1.a-ops.cloud/accountManagement/?tenant=)
    3. Add a random password. (Please note this password is not going to be used since the account is needed for creating an API key. However it is recommended that a strong password is set.)
    4. Edit the newly created User and navigate to the Roles & Groups tab.
    5. Add the user to the aops-bot group created on Step 3.
    6. Navigate to the Details tab and on the "Primary Group" drop-down select aops-bot and press Save
    7. Navigate to the API Token tab and click Regenerate.
    8. Store the API key of this user as it is required for the following steps
  5. Navigate to A conduct and Add a MS Teams Bot object,
  6. Store the "Bot Reference" value that can be seen within in the Advanced tab of the action
  7. Now since the API key and the Bot Reference have been retrieved, we would need to construct the Endpoint Address which is going to be used on the next section: https://prod-eu-west-1.a-ops.cloud/integration/msteams/bot/<API-key>/<Bot-Reference>

A-Ops Bot Import:

  1. Login to https://dev.teams.microsoft.com/apps
  2. Click on "Import App"

    Add new Bot

  3. Once Imported, navigate to "App features" and select: Bot

    Select Bot

  4. Then, click on "Create new bot" or navigate to: https://dev.teams.microsoft.com/bots

    Create New Bot

  5. Click on New Bot

    Create Bot

  6. Name the new Bot example: "aops-bot" and click on "Add"

    Name Bot

  7. Once the new bot has been added, note down the ID as it will be needed later.

  8. Then Click and edit the newly created bot.

    1. On the Field named "Bot endpoint address" Add the Endpoint Address created on the Prerequisite Steps 7. That should look something similar to: https://prod-eu-west-1.a-ops.cloud/integration/msteams/bot/<API-key>/<Bot-Reference>
    2. Navigate to the client secrets tab, and add a client secret and store the secret information. This client secret will be required to be added on the teams-bot actions that will be used as part of flows within A-Ops.
  9. Navigate back to: https://dev.teams.microsoft.com/apps and click on the aops bot that was application that was created.

    1. On the tab Basic information paste in the ID that was saved on step 7.
    2. Navigate again to App Features, select an existing bot, the bot that was created on step 6.
    3. On the section "Select the scopes where people can use your bot", Click on Personal and Team. Then click on Save.

      Bot Configuration

    4. Once all the information has been added publish the application to your org by navigating to "Publish to org" and clicking on Publish your App

    Name Bot

  10. This will need approval within https://admin.teams.microsoft.com/policies/manage-apps

  11. In teams, add a new app. Search for aops and press add. More information can be found on Add an app to Microsoft Teams