azure non http functions
Below directory structure is kind of mandatory , I wasnt able to create the function without it , in some cases it does work. But try to stick to this.
├── hello
│ ├── __init__.py
│ └── function.json
├── hello1
│ ├── __init__.py
│ └── function.json
├── hello3
│ ├── __init__.py
│ └── function.json
├── host.json
└── proxies.json
└── requirements.txt
- Make sure we are only making a zip out of the above directory structure do not include the top level dir.
- Install the requirements using something like below and package them in the zip.
pip install --target=<target_dir> -r requirements.txt
If parsing of this file fails your function doesnt gets created , even when you mention your entrypoint scriptFile
wrong. Nothing will be created and no error will be displayed in console or events logs.
{
"scriptFile": "__init__.py",
"bindings": [
{
"type": "manualTrigger",
"direction": "in",
"name": "input"
}
]
}
scriptFile
: Required : entrypoint for the function. Can be any file you have in your source dirtype
: Required : What kind of trigger you want to have for your function. For more trigger types check thisdirection
: Required : direction of this binding clause.name
: Required: what kind of inputs var your function will be receiving. Can be any name or left empty. In our function we have
def main(input: str):
if we dont specify this input name function will fail with below error:
[Error] Executed 'Functions.<function_name></function_name>' (Failed, Id=adsadasdas1312312, Duration=13ms)
- Make sure you specify the correct entry path.
- We can leave the
Out
section of the function binding if we dont want to return anything followed by not returning anything from the function as well. - Details explanation can be found here
{
"version": "2.0",
"logging": {
"logLevel": {
"default": "Trace"
},
"applicationInsights": {
"samplingSettings": {
"isEnabled": true,
"excludedTypes": "Request"
}
}
}
}
- described perfectly fine here
- Covered here