@grvpandey11/backstage-plugin-scaffolder-backend-module-ms-teams
TypeScript icon, indicating that this package has built-in type declarations

1.0.1 • Public • Published

backstage-plugin-scaffolder-backend-module-ms-teams

This is a ms-teams actions plugin for the scaffolder-backend in Backstage.

This contains a collection of actions for using to send Microsoft Teams messages.

Prerequisites

  • Node must be installed in the environment

  • You must have a Microsoft Teams webhook URL available to send messages to

Getting Started

In the root directory of your Backstage project:

yarn add --cwd packages/backend @grvpandey11/backstage-plugin-scaffolder-backend-module-ms-teams

Add the actions you'd like to the scaffolder:

// packages/backend/src/plugins/scaffolder.ts

import {
  createSendTeamsMessageViaWebhookAction
} from '@grvpandey11/backstage-plugin-scaffolder-backend-module-ms-teams'

import { ScmIntegrations } from '@backstage/integration';
import { createBuiltinActions, createRouter } from '@backstage/plugin-scaffolder-backend';

...

const integrations = ScmIntegrations.fromConfig(env.config);
const builtInActions = createBuiltinActions({
  catalogClient,
  integrations,
  config: env.config,
  reader: env.reader
});

const actions = [
    createSendTeamsMessageViaWebhookAction({config: env.config}),
  ...builtInActions
];

return await createRouter({
  logger: env.logger,
  config: env.config,
  database: env.database,
  reader: env.reader,
  catalogClient,
  actions
});

Add a ms-teams configuration section to your app-config.yaml.

You can omit this by providing a webhook URL in the input of the step in your scaffolder template, but it must be present in one place or the other.

# app-config.yaml

ms-teams:
  webhookUrl: "https://your-url.com"

Example of using the send message action in a template

apiVersion: scaffolder.backstage.io/v1beta3
kind: Template
metadata:
  name: ms-teams-demo
  title: Microsoft Teams message demo
  description: Send a message via MS Teams
spec:
  owner: user:grvpandey11
  type: service

  steps:
    - id: send-ms-teams-message
      name: Send message
      action: ms-teams:sendMessage
      input:
        message: "Hello, world!"
        webhookUrl: "https://your-url.com" # optional if the URL is supplied in the app-config.yaml

Readme

Keywords

none

Package Sidebar

Install

npm i @grvpandey11/backstage-plugin-scaffolder-backend-module-ms-teams

Weekly Downloads

54

Version

1.0.1

License

Apache-2.0

Unpacked Size

10.5 kB

Total Files

9

Last publish

Collaborators

  • grvpandey11