Paten is a framework for azure functions written in Python. Paten provides:
- A command line tool for creating, building, deploying azure functions.
- A decorator based API integrated with in/out bindings.
install paten
package.
$ pip install paten
In addition, Azure CLI
and Azure Functions Core Tools
are required.
See below to install the libraries.
Before deploying to Azure, az login
is required.
$ az login
You have logged in. Now let us find all the subscriptions to which you have access...
In your project directory, type below. Directory {function_app_name} and example python scripts are created.
$ paten new-app {function_app_name}
Then, modify app.py
, like below.
import azure.functions as func
from paten import Paten
app = Paten('{function_app_name}')
@app.http_trigger('req', methods=['GET'], route='/')
@app.out_http()
def example_http_function(req: func.HttpRequest) -> func.HttpResponse:
name = req.params.get('name')
# response
return func.HttpResponse(name)
Before deploying to azure functions, you can test your functions on local with the command below.
$ paten local
Finally, to deploy to azure functions, type below in the directory {function_app_name}
.
The files are generated in ./{function_app_name}/.paten
and your function app is deployed to azure.
$ paten deploy
services | trigger | in | out |
---|---|---|---|
http | O | - | O |
blob | O | X | X |
queue | O | X | 0 |
timer | O | - | - |
- O: supported
- X: not supported yet
- -: officially not supported