Join the Kedro community

Updated last month

Troubleshooting Kedro on Azure Function

At a glance

Guys, I'm having trouble while trying to run kedro on Azure Function.

The error that I'm getting is No module named recsys

Does anyone know how to make sure the package wheel is installed when publishing the function to azure?

I'm executing the following command to publish it from local to Azure:
func azure functionapp publish FUNC_APP_NAME


Further Info:

Here is my app folder

.
β”œβ”€β”€ __pycache__
β”‚   └── function_app.cpython-311.pyc
β”œβ”€β”€ dist
β”‚   β”œβ”€β”€ conf-recsys.tar.gz
β”‚   └── recsys-0.1-py3-none-any.whl
β”œβ”€β”€ function_app.py
β”œβ”€β”€ host.json
β”œβ”€β”€ local.settings.json
β”œβ”€β”€ pyproject.toml
└── requirements.txt

The following is the function_app code:
import logging
import subprocess

import azure.functions as func

app = func.FunctionApp()

@app.route(route="DataPipeline", auth_level=func.AuthLevel.ANONYMOUS)
def DataPipeline(
    req: func.HttpRequest,
) -> func.HttpResponse:
    try:
        subprocess.run(
            [
                "python",
                "-m",
                "recsys",
                "-r",
                "ThreadRunner",
                "--conf-source=dist/conf-recsys.tar.gz",
            ],
            check=True,
            capture_output=True,
        )

        logging.info("Data successfully saved to Blob Storage.")

    except Exception as e:
        logging.error(f"Error processing data: {e}")
        return func.HttpResponse(
            f"{e}\n{e.stderr}",
            status_code=500,
        )

    return func.HttpResponse("DB Extraction Succeded")

And requirements.txt
--find-links dist
azure-functions
pyodbc
sqlalchemy
pandas
recsys 

J
H
4 comments

hi @Hugo Barreto! since you already have a , are you doing pip install recsys-...-any.whl anywhere in your process? otherwise it won't work

Hi @juanlu!

I'm struggling to make the pip install during build time when publishing the app into Azure.

I have no idea how to do it and I'm unable to find an answer online. I hoped someone already faced this issue and had a solution to share

I think i finally found the solution. I'll try and, if it works, I'll post here

Add a reply
Sign up and join the conversation on Slack