Neighbourhood Party Manager

    @probot/adapter-azure-functions

    1.0.23 • Public • Published

    @probot/adapter-azure-functions

    Adapter to run a Probot application function in Azure Functions

    Build Status

    Usage

    Create your Probot Application as always

    // app.js
    module.exports = (app) => {
      app.on("issues.opened", async (context) => {
        const params = context.issue({ body: "Hello World!" });
        await context.octokit.issues.createComment(params);
      });
    };

    Then create a folder with function.json and index.js, e.g.

    // ProbotFunction/function.json
    {
      "bindings": [
        {
          "authLevel": "Anonymous",
          "type": "httpTrigger",
          "direction": "in",
          "name": "req",
          "methods": ["post"]
        },
        {
          "type": "http",
          "direction": "out",
          "name": "res"
        }
      ]
    }

    and

    // ProbotFunction/index.js
    const {
      createAzureFunction,
      createProbot,
    } = require("@probot/adapter-azure-functions");
    const app = require("../app");
    module.exports = createAzureFunction(app, {
      probot: createProbot(),
    });

    For an example Probot App continuously deployed to Azure Functions, see https://github.com/probot/example-azure-function/#how-it-works

    How it works

    @probot/adapter-azure-functions exports everything that probot does plus createAzureFunction.

    createAzureFunction slightly differs from Probot's built-in createNodeMiddleware, as an Azure function does receives slightly different parameters.

    License

    ISC

    Install

    npm i @probot/adapter-azure-functions

    DownloadsWeekly Downloads

    90

    Version

    1.0.23

    License

    ISC

    Unpacked Size

    12.1 kB

    Total Files

    12

    Last publish

    Collaborators

    • bkeepers
    • hiimbex
    • lee-dohm
    • tcbyrd
    • jasonetco
    • gr2m
    • probotbot