https://github.com/Azure-Samples/functions-custom-handlers
Sample code for Azure Functions custom handlers
https://github.com/Azure-Samples/functions-custom-handlers
Last synced: about 2 months ago
JSON representation
Sample code for Azure Functions custom handlers
- Host: GitHub
- URL: https://github.com/Azure-Samples/functions-custom-handlers
- Owner: Azure-Samples
- License: mit
- Created: 2020-03-16T20:24:05.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-10-24T10:05:02.000Z (over 1 year ago)
- Last Synced: 2024-11-13T15:49:30.237Z (7 months ago)
- Language: Go
- Size: 71.3 KB
- Stars: 91
- Watchers: 22
- Forks: 31
- Open Issues: 23
-
Metadata Files:
- Readme: README.md
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
- Security: SECURITY.md
Awesome Lists containing this project
- jimsghstars - Azure-Samples/functions-custom-handlers - Sample code for Azure Functions custom handlers (Go)
README
# Azure Functions custom handlers (preview)
Every Functions app is executed by a language-specific handler. While Azure Functions supports many [language handlers](https://docs.microsoft.com/azure/azure-functions/supported-languages) by default, there are cases where you may want additional control over the app execution environment. Custom handlers give you this additional control.
Custom handlers are lightweight web servers that receive events from the Functions host. Any language that supports HTTP primitives can implement a custom handler.
Custom handlers are best suited for situations where you want to:
- Implement a Functions app in a language beyond the officially supported languages
- Implement a Functions app in a language version or runtime not supported by default
- Have granular control over the app execution environmentWith custom handlers, all [triggers and input and output bindings](https://docs.microsoft.com/azure/azure-functions/functions-triggers-bindings) are supported via [extension bundles](https://docs.microsoft.com/azure/azure-functions/functions-bindings-register).
Read more [about custom handlers in detail](https://docs.microsoft.com/azure/azure-functions/functions-custom-handlers).
## Samples
The following samples demonstrate how to implement a custom handler in the following languages:
- [C#](https://github.com/Azure-Samples/functions-custom-handlers/tree/master/CSharp)
- [Go](https://github.com/Azure-Samples/functions-custom-handlers/tree/master/go)
- [Java](https://github.com/Azure-Samples/functions-custom-handlers/tree/master/Java)
- [JavaScript](https://github.com/Azure-Samples/functions-custom-handlers/tree/master/node)
- [R](https://github.com/Azure-Samples/functions-custom-handlers/tree/master/R)
- [Rust](https://github.com/Azure-Samples/functions-custom-handlers/tree/master/Rust)## Docker
Following is an example dockerfile using azure functions node base image
```
# To enable ssh & remote debugging on app service change the base image to the one below
# FROM mcr.microsoft.com/azure-functions/node:2.0-appservice
FROM mcr.microsoft.com/azure-functions/node:2.0ENV AzureWebJobsScriptRoot=/home/site/wwwroot \
AzureFunctionsJobHost__Logging__Console__IsEnabled=trueCOPY . /home/site/wwwroot
RUN cd /home/site/wwwroot
```
Copy any of the samples to the directory where you have dockerfile and build an image