I have the following code structure in my Python (3.12.3) application: **ROOT** -- .venv -- azure_functions ---- function_app.py ---- host.json ---- local.settings.json ---- requirements.json -- src ---- __init__.py ---- main.py -- tests ---- test_action.py -- .gitignore -- requirements.txt -- setup.py where: venv - virtual env directory that has installed requirements.json deps from the root and azure_functions folders azure_functions - the folder that has files related to azure function (http triggers) function_app.py - a problematic http trigger that can't call llm_call function from main.py For the record, the trigger inside azure_functions directory can be successfully deployed and called in case if it has only printing output as string inside, so azure function related configuration is correct. azure_functions/requirements.json - consist of single line azure-functions. src/__init__.py (empty file) / src/main.py - module and his definition, the methods (like llm_call) inside main.py can be successfully called from tests folder, but not from azure_functions directory requirements.txt - deps related to main.py files tests - the folder with tests, test_action.py can successfully call methods from main.py just with simple configuration: from src.main import llm_call setup.py: # a simple package/module related configuration from setuptools import setup, find_packages setup(name="main", version="1.0", packages=find_packages()) The issue I have is when I consume methods from the main package in function_app.py via: from src.main import llm_call # just with this single new line, no actual usage of this below I see no issues in VS Code (no highlighted lines), but when I deploy the application to azure, the deployment seems failed (even though I see no errors in the log other than this line AM appname-func: No HTTP triggers found. in output). I'm deploying it from VS code and see that my function disappear right after this from Azure Resources UI (Function App => Functions): and can't be visible in azure UI. As soon as I remove this line from src.main import llm_call from the trigger and deploy it one more time, all the logic become working and I see again the deployed function on the above screenshot. It looks like the issue is how I consume methods from main.py module in function_app.py, but not sure how I can troubleshot it. Any help would be appreciated. UPDATE: main.py: from langchain.chat_models import ChatOpenAI from langchain.prompts.chat import ( SystemMessagePromptTemplate, HumanMessagePromptTemplate, ChatPromptTemplate ) from typing import Callable from langchain.chains import LLMChain from langchain.schema import BaseOutputParser import os model_to_use="gpt-4o-mini" class CustomOutputParser(BaseOutputParser): def parse(self, text: str): return text def llm_call(model, system_template, human_template, param_provider: Callable[[], dict], custom_output_parser) -> str: try: api_key = os.environ['OPENAI_API_KEY'] temperature=0.7 max_tokens=2048 chat_model = ChatOpenAI(model=model, api_key=api_key, temperature=temperature, max_tokens=max_tokens) system_message_prompt = SystemMessagePromptTemplate.from_template(system_template) human_message_prompt = HumanMessagePromptTemplate.from_template(human_template) chat_prompt = ChatPromptTemplate.from_messages([system_message_prompt, human_message_prompt]) chain = LLMChain( llm=chat_model, prompt=chat_prompt, output_parser=custom_output_parser ) params = param_provider() return chain.run(**params) except Exception as e: print(f"An error occurred while calling the LLM: {e}") raise e function code: import azure.functions as func import logging from src.main import llm_call app = func.FunctionApp(http_auth_level=func.AuthLevel.FUNCTION) @app.route(route="llm_httptrigger") def llmhttptrigger(req: func.HttpRequest) -> func.HttpResponse: logging.info('Python HTTP trigger function processed a request!') test code: import unittest from src.main import llm_call class TestCallLLMFunction(unittest.TestCase): def test_call_llm(self): category = "category1" .. UPDATE2: Thanks @PravallikaKV for suggestion about moving the function related code into the root folder, unfortunately it didn't help. I still don't see a function on the portal and still see the following in the deploy output: 5:26:37 PM appname-func: No HTTP triggers found. For the record1, it looks like the problem is not about the folders structure, since this structure is generated by VS Code wizard where I've chosen the azure_functions directory as the place where the function code should be saved. And if I remove calls of functions taken from main.py, it works well and I can call this ("hello world" like) http trigger via web api request, ie it's deployed successfully in this case. For the record2, this code I use to create venv folder: 1. python -m venv .venv 2. .venv\Scripts\activate 2.1. Configure python interpreter path from .venv in VS Code 3. pip.exe install -r .\requirements.txt 4. pip.exe install -r .\azure_functions\requirements.txt 5. pip install -e . I feel that some of the venv configuration is not visible (not sure how it should be configured) on azure function side, but can't really see how to proceed here since no errors are triggered during the deployment. UPDATE3: If i start creating an azure function from scratch, one of the wizard steps is to configure virtual environment: previously, I skipped this part, now I'm trying to configure it and see the following error: 3.12.3 is the python version I use on my machine and in the venv (providing absolute path to python in .venv folder gives the same error), not sure where this error comes from.. UPDATE4: Apparently, python version 3.12 I used before is not supported by azure, however switching to 3.11 resolves points in UPDATE3, but didn't help with actual problem too Continue reading...