From 40a4d934b0f7b6cae4f04ed7c41de7f802aff8fd Mon Sep 17 00:00:00 2001 From: Iain-S <25081046+Iain-S@users.noreply.github.com> Date: Fri, 3 Jan 2025 11:57:19 +0000 Subject: [PATCH] Move usage to v2 model --- usage_function/.dockerignore | 1 + usage_function/Dockerfile | 2 +- usage_function/host.json | 2 +- usage_function/monthly_usage/function_app.py | 1 + 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/usage_function/.dockerignore b/usage_function/.dockerignore index d7f4423..8536085 100644 --- a/usage_function/.dockerignore +++ b/usage_function/.dockerignore @@ -4,6 +4,7 @@ # ...except for the bare necessities !poetry.lock !pyproject.toml +!host.json !usage/*.py !usage/function.json !utils/*.py diff --git a/usage_function/Dockerfile b/usage_function/Dockerfile index 1a28a4a..c729e58 100644 --- a/usage_function/Dockerfile +++ b/usage_function/Dockerfile @@ -18,6 +18,6 @@ WORKDIR /home/site/wwwroot RUN ~/.local/share/pypoetry/venv/bin/poetry config virtualenvs.create false -COPY pyproject.toml poetry.lock ./ +COPY pyproject.toml poetry.lock host.json ./ RUN ~/.local/share/pypoetry/venv/bin/poetry install --only main diff --git a/usage_function/host.json b/usage_function/host.json index 3e7940a..103c114 100644 --- a/usage_function/host.json +++ b/usage_function/host.json @@ -10,7 +10,7 @@ }, "extensionBundle": { "id": "Microsoft.Azure.Functions.ExtensionBundle", - "version": "[2.*, 3.0.0)" + "version": "[4.*, 5.0.0)" }, "functions": [ "usage", diff --git a/usage_function/monthly_usage/function_app.py b/usage_function/monthly_usage/function_app.py index e2a2a52..48995ea 100644 --- a/usage_function/monthly_usage/function_app.py +++ b/usage_function/monthly_usage/function_app.py @@ -47,6 +47,7 @@ def get_dates() -> Union[None, Tuple[date], Tuple[date, date]]: return day1, day2 +@app.function_name(name="monthly_usage") @app.timer_trigger( schedule="0 10 */2 7,8 * *", arg_name="my_timer", run_on_startup=False )