Hugo Barreto
02/05/2025, 9:54 PMNo 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,
)
<http://logging.info|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
Hall
02/05/2025, 9:54 PMJuan Luis
02/05/2025, 11:29 PMpip install recsys-...-any.whl
anywhere in your process? otherwise it won't workHugo Barreto
02/06/2025, 4:23 PMHugo Barreto
02/06/2025, 4:53 PMJuan Luis
02/06/2025, 5:15 PM