https://github.com/diberry/azure-function-middle
https://github.com/diberry/azure-function-middle
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/diberry/azure-function-middle
- Owner: diberry
- Created: 2019-08-30T13:20:12.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-01-04T08:32:16.000Z (over 3 years ago)
- Last Synced: 2024-10-05T03:40:54.642Z (over 1 year ago)
- Language: TypeScript
- Size: 533 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 13
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Middleware for Azure Function triggers
These classes are used in the Azure function triggers. Pass in the entire incoming parameter to the function. You receive the entire outputParam back.
## Usage for Blob Trigger to Queue output
```
const fnMiddleWare = require('azure-function-middleware');
// azure function for blob trigger
module.exports = async function (context, myBlob) {
const blobTrigger = new fnMiddleWare.BlobTrigger();
// send in blob, get back queue message for out param
context.bindings.outputQueueItem = blobTrigger.readBlobFileText(context.bindingData.myBlob);
context.done();
}
```
## Usage for Queue Trigger to Queue output
```
const fnMiddleWare = require('azure-function-middleware');
// azure function for blob trigger
module.exports = async function (context, myQueueItem) {
const queueTrigger = new fnMiddleWare.QueueTrigger();
// send in queue message, get back queue message for out param
context.bindings.outputQueueItem = queueTrigger.detectText(myQueueItem);
context.done();
}
```