from __future__ import annotations

import logging

import azure.functions as func

from app.services.blob_service import describe_blob

blob_blueprint = func.Blueprint()  # type: ignore[no-untyped-call]


@blob_blueprint.blob_trigger(
    arg_name="blob",
    path="samples-workitems/{name}",
    connection="AzureWebJobsStorage",
)
def process_blob(blob: func.InputStream) -> None:
    logging.info(describe_blob(blob))
