-
Notifications
You must be signed in to change notification settings - Fork 107
Closed
Closed
Copy link
Description
Hi all,
I need help setting up a project structure for my scenario - 3 different functions deployed in a single Azure Functions App. As far as I know, the only way to do so is to put all code logic of 3 functions as well as triggers in a single function_app.py
, which is impractical from code maintainability and scalability perspectives. Something like the one below will work, but I don't think I'd go with it.
app = func.FunctionApp()
@app.schedule(schedule="0 0 2 * * *", arg_name="myTimer", run_on_startup=True,
use_monitor=False)
def FunctionA(myTimer: func.TimerRequest) -> None:
do_something_for_functionA()
if myTimer.past_due:
logging.info('The timer is past due!')
logging.info('Python timer trigger function executed.')
@app.schedule(schedule="0 0 2 * * *", arg_name="myTimer", run_on_startup=True,
use_monitor=False)
def FunctionB(myTimer: func.TimerRequest) -> None:
do_something_for_functionB()
if myTimer.past_due:
logging.info('The timer is past due!')
logging.info('Python timer trigger function executed.')
@app.schedule(schedule="0 0 2 * * *", arg_name="myTimer", run_on_startup=True,
use_monitor=False)
def FunctionC(myTimer: func.TimerRequest) -> None:
do_something_for_functionC()
if myTimer.past_due:
logging.info('The timer is past due!')
logging.info('Python timer trigger function executed.')
I need something more management and organized like below one (if possible):
.
└── Functions/
├── .venv
├── .python_packages
├── .vscode
├── .funcignore
├── .gitignore
├── function_app.py
├── function_a.py
├── function_b.py
├── function_c.py
├── host.json
├── local.settings.json
└── requirements.txt
Metadata
Metadata
Assignees
Labels
No labels