Skip to content
betterstack-alchemyUnofficial

Errors.MicrosoftTeamsIntegration

Kind ResourceType id BetterStack.Errors.MicrosoftTeamsIntegrationSource src/Errors/MicrosoftTeamsIntegration.tsOffline only Tested against the offline mock only: the lifecycle runs against the offline mock only (test/Errors/MicrosoftTeamsIntegration.test.ts).

An Error tracking Microsoft Teams integration: which errors reach which channels of the team the Better Stack app was added to.

The API cannot create or delete one: add the Better Stack app to a Microsoft Teams team from the Better Stack web app first, then this resource takes over the integration named by integrationId and applies the settings you declare. Destroying the resource only forgets it; the integration and its settings stay in Better Stack. A missing integrationId fails the deploy.

routes and tagFilter are replaced as a whole on update; notifications changes only the toggles sent, and only the toggles you declare are compared with what the API answers. A route’s channels are named by id only: the channel names Teams shows are not kept in the attributes.

Configuring a connected Microsoft Teams integration

Section titled “Configuring a connected Microsoft Teams integration”

Route one application’s production errors to a channel

const errors = yield* BetterStack.Errors.Application("api-errors", {
platform: "bun_errors",
});
yield* BetterStack.Errors.MicrosoftTeamsIntegration("teams", {
integrationId: "12345",
routes: [
{
applications: [{ applicationId: errors.id, environments: ["production"] }],
channels: [{ id: "19:a1b2c3d4e5f6@thread.tacv2" }],
},
],
occurrenceThresholdCount: 10,
occurrenceThresholdInterval: "hour",
});

integrationId string required

The id of the Microsoft Teams integration to take over: one connected in the Better Stack web app (Errors → Integrations → Microsoft Teams), from List Microsoft Teams integrations. Changing it takes over that integration instead; the previous one keeps its settings.

affectedUsersThresholdCount number

Total number of affected users for notifications.affected_users_threshold. A positive whole number.

notifications ErrorsMicrosoftTeamsIntegrationNotifications

Which events post to the channels, as under Notify me when in the web app. An update changes only the toggles sent.

occurrenceThresholdCount number

Number of occurrences for notifications.occurrence_threshold. A positive whole number.

occurrenceThresholdInterval "minute" | "hour" | "day" | "week" | string

Time window for notifications.occurrence_threshold.

routes UpdateErrorsMicrosoftTeamsIntegrationRequestRoutesItem[]

Which applications' errors go to which channels. An application that isn't in any route gets no messages, unless one of the routes has no applications. Empty means everything goes to the channel the app was added to. An update replaces the whole list.

tagFilter UpdateErrorsMicrosoftTeamsIntegrationRequestTagFilterItem[]

The tags an error must have to be posted. An error matches when one of its exceptions has every tag listed, each set to one of the tag's values. Empty means every error. You can list up to 10 tags, each once, with up to 50 values each. A tag or value can be up to 200 characters. An update replaces the whole list. The new_releases and spike_protection notifications and state changes are posted whatever the tags.

teamId string

Team that owns the resource, such as t123. Defaults to the credentials' team (BETTERSTACK_TEAM_ID, or the profile's team). Changing it replaces the resource.

id string always set

The errors_microsoft_teams_integration's id.

affectedUsersThresholdCount number

Total number of affected users for notifications.affected_users_threshold. A positive whole number.

microsoftTeamsChannelName string | null

Channel the app was added to, which gets every error while routes is empty.

microsoftTeamsTeamName string | null

Microsoft Teams team the Better Stack app was added to.

notifications ErrorsMicrosoftTeamsIntegrationNotifications

Which events post to the channels, as under Notify me when in the web app. An update changes only the toggles sent.

occurrenceThresholdCount number

Number of occurrences for notifications.occurrence_threshold. A positive whole number.

occurrenceThresholdInterval "minute" | "hour" | "day" | "week"

Time window for notifications.occurrence_threshold.

routes UpdateErrorsMicrosoftTeamsIntegrationRequestRoutesItem[]

Which applications' errors go to which channels, in the request's shape: application ids as strings, channels by id.

tagFilter ErrorsMicrosoftTeamsIntegrationTagFilterItem[]

The tags an error must have to be posted. An error matches when one of its exceptions has every tag listed, each set to one of the tag's values. Empty means every error. You can list up to 10 tags, each once, with up to 50 values each. A tag or value can be up to 200 characters. An update replaces the whole list. The new_releases and spike_protection notifications and state changes are posted whatever the tags.

teamId string

ID of the team that owns the integration, such as t123.

teamName string

Name of the team that owns the integration.

MicrosoftTeamsIntegration.lookup(props) reads an object this stack does not manage. It is never created, updated or deleted.

id string required

The integration's id.

teamId string

Team that owns it, such as t123. Defaults to the credentials' team.