yokawasa / azure-functions-python-samples

Azure Functions Python Sample Codes. NOTE: The project, hosted in a repository, is no longer actively maintained by its creators or contributors. There won't be any further updates, bug fixes, or support from the original developers in the project.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

1 functions loaded; Generating 0 job function(s)

mawah opened this issue · comments

I am struggling to test one of the samples from this repository, eventhub-trigger-table-out-bindings, in Azure Functions Core Tools. It appears that I've successfully populated the connection strings in local.settings.json and resource names in function.json: the function loads without any errors. However, I get a message I don't understand staying:

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.).

It appears there is some distinction between "functions" and "job functions" (I know nothing about it), but this error message doesn't explain it and seems maybe intended for a different programming language? I don't know why the __init__.py file in eventhub-trigger-table-out-bindings doesn't qualify as a job function nor how to fix the problem. (It appears that there is a problem, because nothing happens when I run the associated send-event.py script to trigger the function.)

Here is the full output displayed when I launch local execution with Azure Functions Core Tools:

> func start

                  %%%%%%
                 %%%%%%
            @   %%%%%%    @
          @@   %%%%%%      @@
       @@@    %%%%%%%%%%%    @@@
     @@      %%%%%%%%%%        @@
       @@         %%%%       @@
         @@      %%%       @@
           @@    %%      @@
                %%
                %

Azure Functions Core Tools (2.1.748 Commit hash: 5db20665cf0c11bedaffc96d81c9baef7456acb3)
Function Runtime Version: 2.0.12134.0
[11/13/2018 10:56:45 PM] Building host: startup suppressed:False, configuration suppressed: False
[11/13/2018 10:56:45 PM] Reading host configuration file 'C:\Users\mawah\Documents\dni\featurization\host.json'
[11/13/2018 10:56:45 PM] Host configuration file read:
[11/13/2018 10:56:45 PM] {
[11/13/2018 10:56:45 PM]   "version": "2.0"
[11/13/2018 10:56:45 PM] }
[11/13/2018 10:56:46 PM] Initializing Host.
[11/13/2018 10:56:46 PM] Host initialization: ConsecutiveErrors=0, StartupCount=1
[11/13/2018 10:56:46 PM] Starting JobHost
[11/13/2018 10:56:46 PM] Starting Host (HostId=37438110424-384678464, InstanceId=cc3bd0ed-d82f-4a4c-85da-0301b6824a16, Version=2.0.12134.0, ProcessId=9320, AppDomainId=1, Debug=False, FunctionsExtensionVersion=~2)
[11/13/2018 10:56:46 PM] Loading functions metadata
[11/13/2018 10:56:46 PM] 1 functions loaded
[11/13/2018 10:56:46 PM] Generating 0 job function(s)
[11/13/2018 10:56:46 PM] 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.).
[11/13/2018 10:56:46 PM] Host initialized (207ms)
[11/13/2018 10:56:47 PM] Host started (222ms)
[11/13/2018 10:56:47 PM] Job host started
Hosting environment: Production
Content root path: C:\Users\mawah\Documents\dni\featurization
Now listening on: http://0.0.0.0:7071
Application started. Press Ctrl+C to shut down.
Listening on http://0.0.0.0:7071/
Hit CTRL-C to exit...

Any advice appreciated!

Found the problem. I'd downloaded my connection string from my Azure Functions app as follows:

func azure functionapp fetch-app-settings <my azure functions app name>

...and this pulled down several other values to my local.settings.json file, including:

"FUNCTIONS_WORKER_RUNTIME": "node",

This value is the type of Azure Functions app I created in Azure. (Python was not listed as an option when I created my Azure Functions resource: my choices during deployment were .NET and Node.js, I think.) I manually changed the runtime value from node to python and was able to get things working.

Is there a way to create an Azure Functions cloud resource with a Python runtime, for compatibility with Python functions I create using Azure Functions Core Tools (and the samples here)?

@mawah Very sorry for the late response.
In V2 functions, Python is in preview but if you use the latest Azure function runtime, you'll see Python listed. Please read the following pages:

I'm closing this but please feel free to open if there are any issues