Microsoft Teams

Microsoft Teams is the central meeting place for many organizations and DevOps teams for code reviews, incident notifications, and more. The Scalr Teams integration enables you to be more efficient and move at a faster pace, and at Scalr, we believe in meeting our users where they work. The integration for Teams will send notifications based on run events. The integration can be added through Microsoft AppSource.

Setup

After adding the Scalr app to your team from the Teams Store, start by linking your Teams user to an authenticated user in Scalr by issuing the @scalr connect command. This is required to manage the channel's notification subscriptions.

The following commands can be used in Microsoft Teams to configure the integration:

CommandDescription
@scalr connectConnect your Teams user to the Scalr user
@scalr disconnectRemove the association with the Scalr account
@scalr subscribe events[, ...] environments[, ...] workspaces[, ...]Subscribe current channel to select events. 'environments' and 'workspaces' arguments define the Scalr environments and workspaces which the events will stream from
@scalr unsubscribeRemove the channel's subscription
@scalr helpDisplay this help message

At least one event and one environment must be supplied to the subscribe command. Adding the environment means that the channel will receive notifications for all the runs from that environment. Workspaces can be specified to narrow down notifications to only runs in the given workspaces (the workspaces must belong to the environments supplied in the environments block).

The integrations:manage permission is needed in Scalr to execute the @scalr subscribe command as it creates a new Teams connection.

Events

Possible events are:

EventDescription
run_approval_requiredThe run is waiting for a user to approve it
run_successAny type of run has finished successfully (this includes canceled/discarded runs)
dry_run_successThe dry run (plan-only) has finished successfully
run_erroredAny type of run failed
apply_successThe apply run finished successfully
apply_erroredThe apply run errored
dry_run_erroredThe dry run (plan-only) has failed

Examples

Receive notifications only for the run_approval_required and run_errored events from the workspaces ws-xxx, ws-yyy in the env-xxx environment:

@scalr subscribe events[run_approval_required, run_errored] environments[env-xxx] workspaces[ws-xxx, ws-yyy]

Receive notifications for all possible run outcomes from the entire env-xxx environment:

@scalr subscribe events[run_approval_required, run_errored, dry_run_errored, run_success, dry_run_success] environments[env-xxx]

Notifications and Approvals

When the Teams notification is received there will be an option to "Review run", which gives you the option to approve or decline it:

888

The first time a user goes through this workflow Scalr will authorize the bot for Teams. Once authorized, the bot will check that the person taking action on the run has the proper permission in Scalr to do so each time an action button is clicked. Once an action is taken, an optional reason can be given for the approve/deny and it will then appear in the run information in Scalr.