0

I'm trying to make an application (let's call it "uploder") that takes in Azure Storage Queue messages, does some work and has no output. However, I'm getting this generic error that's preventing my app from running:

No job functions found. Try making your job classes and methods public. If you're using binding extensions (e.g. Azure Storage, ServiceBus, Timers, etc.) make sure you've called the registration method for the extension(s) in your startup code (e.g. builder.AddAzureStorage(), builder.AddServiceBus(), builder.AddTimers(), etc.).

Which is the only piece of useful information that is making it to Azure Application Insights logger when I try to deploy my functions app.

I made a different companion app to this that runs fine. It's a pure-python web project (Flask) and deployment went exactly as expected. However, the original app--"uploader"--where I'm getting this error, uses a C++ module integrated with the main python code, which leads me to believe that this difference is causing the issue with "uploader".

I contacted Azure support and they were able to dig this up: GLIBCXX_3.4.29' not found (required by <in-house package>.cpython-311-x86_64-linux-gnu.so). I tried many different python versions, thinking that maybe the GLIBC version that was used to build this app was not compatible with the version that was trying to run the app on the cloud. I went from Python 3.11 - 3.9 with no change in status, still the generic message "No job functions found...".

More recently, my Azure contact has said that maybe my binding extensions might be the issue. However, the only binding that I can find for Python is as follows:

In host.json:

{
  "version": "2.0",
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[4.*, 5.0.0)"
  },
...

In function_app.py:

import azure.functions as func

app = func.FunctionApp()


@app.function_name("upload_tool_app")
@app.queue_trigger(
    arg_name="message",
    queue_name="<queue_name>",
    connection="<connection_string_name>",
)
def main(message: func.QueueMessage):
    # Do Stuff...

In function.json:

{
  "scriptFile": "function_app.py",
  "bindings": [
    {
      "name": "message",
      "type": "queueTrigger",
      "direction": "in",
      "queueName": "<queue_name>",
      "connection": "<connection_string_name>"
    }
  ]
}

Is there something obvious that I am missing? I have been struggling with getting this one app hosted for over a week now and I am about ready to throw in the towel...

Also, I should add that this works just fine when I try to run locally using func start.


I have also already checked the settings for:

  • FUNCTIONS_WORKER_RUNTIME (python)
  • PYTHON_ISOLATE_WORKER_DEPENDENCIES (1)
  • FUNCTIONS_EXTENSION_VERSION (~4)

All my dependencies are accounted for (I created a new venv and only installed what was outlined in the ADO Pipeline task).

3
  • Please share your requirements.txt. Commented May 6 at 8:33
  • Is it Python V2 function? If so, function.json is not needed in Python V2 function. Commented May 6 at 9:43
  • Requirements file contents: azure-core azure-common azure-cosmosdb-table azure-storage-blob azure-storage-queue azure-appconfiguration azure-identity python-dotenv azure-keyvault-secrets opencensus-ext-azure Plus two in-house packages with no additional requirements.
    – Joe Walker
    Commented May 7 at 19:19

1 Answer 1

0

The function code you have in function_app.py is for Python V2. If you are using Python V2 Azure function, there is no need of function.json. Because function.json applies only for Python V1.

  • Refer MSDOC and modify your code accordingly.

I have created Python V2 Queue Trigger Azure function.

Folder Structure:

|   .funcignore
|   .gitignore
|   function_app.py
|   host.json
|   local.settings.json
|   requirements.txt
|
+---.vscode
|       extensions.json
|       launch.json
|       settings.json
|       tasks.json
|
+---env

function_app.py:

app = func.FunctionApp()

@app.function_name("myfunction")
@app.queue_trigger(arg_name="azqueue", queue_name="queue1",
                               connection="QueueConnectionString") 
def queue_trigger(azqueue: func.QueueMessage):
    logging.info('Python Queue trigger processed a message: %s',
                azqueue.get_body().decode('utf-8'))

local.settings.json:

{
  "IsEncrypted": false,
  "Values": {
    "FUNCTIONS_WORKER_RUNTIME": "python",
    "AzureWebJobsFeatureFlags": "EnableWorkerIndexing",
    "AzureWebJobsStorage": "UseDevelopmentStorage=true",
    "QueueConnectionString":"<storage_connection_string>"
  }
}

host.json:

{
  "version": "2.0",
  "logging": {
    "applicationInsights": {
      "samplingSettings": {
        "isEnabled": true,
        "excludedTypes": "Request"
      }
    }
  },
  "extensionBundle": {
    "id": "Microsoft.Azure.Functions.ExtensionBundle",
    "version": "[4.*, 5.0.0)"
  }
}
  • Deployed the function to Azure Function App(Consumption plan).

enter image description here

Portal:

enter image description here

2
  • 1
    Thanks for the reply, I removed the function.json file and copied the structure of the files you mentioned but I am still not seeing the function register on the web portal.
    – Joe Walker
    Commented May 7 at 15:58
  • Create a new functionapp and deploy the function again. Commented May 15 at 3:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.