Skip to content

Commit a5a6274

Browse files
committed
docs(README): initial version
1 parent 2c258e4 commit a5a6274

File tree

1 file changed

+69
-0
lines changed

1 file changed

+69
-0
lines changed

README.md

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
# 🚧 WORK IN PROGRESS [#1](https://github.com/probot/adapter-azure-functions/pull/1)
2+
3+
# `@probot/adapter-azure-functions`
4+
5+
> Adapter to run a [Probot](https://probot.github.io/) application function in [Azure Functions](https://azure.microsoft.com/services/functions/)
6+
7+
[![Build Status](https://github.com/probot/adapter-azure-functions/workflows/Test/badge.svg)](https://github.com/probot/adapter-azure-functions/actions)
8+
9+
## Usage
10+
11+
Create your Probot Application as always
12+
13+
```js
14+
// app.js
15+
module.exports = (app) => {
16+
app.on("issues.opened", async (context) => {
17+
const params = context.issue({ body: "Hello World!" });
18+
await context.octokit.issues.createComment(params);
19+
});
20+
};
21+
```
22+
23+
Then create a folder with `function.json` and `index.js`, e.g.
24+
25+
```js
26+
// ProbotFunction/function.json
27+
{
28+
"bindings": [
29+
{
30+
"authLevel": "Anonymous",
31+
"type": "httpTrigger",
32+
"direction": "in",
33+
"name": "req",
34+
"methods": ["post"]
35+
},
36+
{
37+
"type": "http",
38+
"direction": "out",
39+
"name": "res"
40+
}
41+
]
42+
}
43+
```
44+
45+
and
46+
47+
```js
48+
// ProbotFunction/index.js
49+
const {
50+
createAzureFunctionsMiddleware,
51+
createProbot,
52+
} = require("@probot/adapter-azure-functions");
53+
const app = require("../app");
54+
module.exports = createAzureFunctionsMiddleware(app, {
55+
probot: createProbot(),
56+
});
57+
```
58+
59+
For an example Probot App continuously deployed to Azure Functions, see https://github.com/probot/example-azure-function/#how-it-works
60+
61+
## How it works
62+
63+
`@probot/adapter-azure-functions` exports everything that [`probot`](https://github.com/probot/probot/#readme) does plus `createAzureFunctionsMiddleware`.
64+
65+
`createAzureFunctionsMiddleware` slightly differs from Probot's built-in `createNodeModdleware`, as an Azure function does receives slightly different parameters.
66+
67+
## License
68+
69+
[ISC](LICENSE)

0 commit comments

Comments
 (0)