Azure / azure-functions-core-tools

Command line tools for Azure Functions
MIT License
1.28k stars 424 forks source link

No job functions found if run "func start --no-build" #2705

Open doggy8088 opened 2 years ago

doggy8088 commented 2 years ago

Here are the steps to reproduce the problem.

  1. Check Azure Functions Core Tools version

    func --version
    3.0.3734
  2. Use .NET Core 3.1.400 SDK

    dotnet new globaljson --sdk-version 3.1.400
  3. Create function app

    func init MyFunc --worker-runtime dotnet
    cd MyFunc
  4. Create a function

    func new --template "Http trigger" --name Funcion1
  5. Starting my function app

    func start

    Here is the log (no problem):

    Azure Functions Core Tools
    Core Tools Version:       3.0.3734 Commit hash: 61192bb28820be76916f85209916152801483456  (32-bit)
    Function Runtime Version: 3.1.4.0
    
    [2021-09-10T15:17:20.590Z] Found G:\Projects\MyFunc\MyFunc.csproj. Using for user secrets file configuration.
    
    Functions:
    
            Funcion1: [GET,POST] http://localhost:7071/api/Funcion1
    
    For detailed output, run func with --verbose flag.
  6. Starting my function app with --no-build option

    func start --no-build

    Here is the log (No job functions found):

    Azure Functions Core Tools
    Core Tools Version:       3.0.3734 Commit hash: 61192bb28820be76916f85209916152801483456  (32-bit)
    Function Runtime Version: 3.1.4.0
    
    [2021-09-10T15:18:27.514Z] Found G:\Projects\MyFunc\MyFunc.csproj. Using for user secrets file configuration.
    [2021-09-10T15:18:28.046Z] 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.).
    For detailed output, run func with --verbose flag.

    I expected I can find all my functions with --no-build option because I already build my project.

apsthisdev commented 2 years ago

+1, Facing the same problem. The Blazor Static Web App + Azure Function + Playwright E2E tests setup requires the func start --no-build to start the func app without build.

Because of this issue I have to add an arbitrary delay in test execution for building the Azure Function and then continue e2e test. This increases the test execution time significantly.

jonathanford commented 1 year ago

Having the same issue when wanting to run the same function app locally multiple times with different environment variables.

ameyasubhedarats commented 1 year ago

It is impacting us as well. Task.Delay() to let the function app build first. E2E tests takes a long time to finish.

cicorias commented 10 months ago

what is going on with this? a freshly scaffolded project and getting this error message after second run.

why?

image

zebleck commented 5 months ago

same here

Dona278 commented 5 months ago

How is possible after more than 2 years to have this issue? I tried to figure out the build-and-start process of a function but it is very complicated.

The only way to start a dotnet-isolated function locally with extension is run from VS, or manually delete the obj between executions.

zebleck commented 5 months ago

sorry, in my case I just forgot a correctly configured local.settings.json file.

teyc commented 3 months ago
  • So run the command with --no-build and tadan! No job to start.. and the searching is tried under bin/Debug..
    • Same issue if we build first with visual studio and then try to start function with --no-build, the output folders mismatching

The only way to start a dotnet-isolated function locally with extension is run from VS, or manually delete the obj between executions.

Update your csproj file

    <PackageReference Include="Microsoft.Azure.Functions.Worker.Sdk" Version="1.17.2" />

and delete the obj and bin folder once, and the problem should be resolved, and you can run func start multiple times