I am using azure functions app to deploy a function from my VS Code. I have checked for the local.settings.json and I’ve added
AzureWebJobsFeatureFlags: EnableWorkerIndexing
“AzureWebJobsStorage”: “UseDevelopmentStorage=true” these settings in my json too.
Also I have checked for dependencies and all dependencies are fullfilled.
from azure.search.documents.models import VectorizableTextQuery
import os
from azure.core.credentials import AzureKeyCredential
from azure.search.documents import SearchClient
from azure.core.credentials import AzureKeyCredential
These are the imports I’m making for my code, can someone tell me why this problem is happening?
2024-07-18 [Information] Loading functions metadata
2024-07-18 [Information] Reading functions metadata (Custom)
2024-07-18 [Information] 1 functions found (Custom)
2024-07-18 [Information] 0 functions loaded
2024-07-18 [Information] Loading functions metadata
2024-07-18 [Information] Reading functions metadata (Custom)
2024-07-18 [Information] 1 functions found (Custom)
2024-07-18 [Information] 0 functions loaded
10:39:06 AM : Creating directory for command manifest file if it does not exist
10:39:06 AM : Removing existing manifest file
10:39:06 AM : Running pip install...
10:39:20 AM : Syncing triggers...
10:39:22 AM : Querying triggers...
10:39:26 AM : No HTTP triggers found.
These are the logs which I have provided and you can check from the logs that there is no problem with the code as the function is working perfect on local but when it is deployed the HTTP trigger is not working. Log is No HTTP triggers found.
Can someone help me with this problem and tell me if I’m missing something? Requirements.txt local.setting.json host.json
Sarthak Sandilya is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
5
I am using default code with the same imports alike you.
import azure.functions as func
import logging
import os
from azure.search.documents.models import VectorizableTextQuery
from azure.search.documents import SearchClient
from azure.core.credentials import AzureKeyCredential
app = func.FunctionApp(http_auth_level=func.AuthLevel.ANONYMOUS)
@app.route(route="http_trigger")
def http_trigger(req: func.HttpRequest) -> func.HttpResponse:
logging.info('Python HTTP trigger function processed a request.')
name = req.params.get('name')
if not name:
try:
req_body = req.get_json()
except ValueError:
pass
else:
name = req_body.get('name')
if name:
return func.HttpResponse(f"Hello, {name}. This HTTP triggered function executed successfully.")
else:
return func.HttpResponse(
"This HTTP triggered function executed successfully. Pass a name in the query string or in the request body for a personalized response.",
status_code=200
)
You need to add the below packages in requirements.txt file.
azure-functions
azure-search-documents
azure-core
By doing this, I am able to deploy successfully to function app.
I can see the function in portal and able to access it too.
25