extensions icon indicating copy to clipboard operation
extensions copied to clipboard

Microsoft.Extensions.Http package breaks Azure Function v2 app

Open jordanchang opened this issue 7 years ago • 2 comments

Describe the bug

This nuget package seems to causes issues on the startup of an Azure Function 2.0 app.

To Reproduce

Steps to reproduce the behavior:

  1. Create a new Azure Function project from VSCode or VS2017
  2. Add nuget package Microsoft.Extensions.Http
  3. Ctrl+F5 to run the function locally
  4. Error appears

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

Executing task: func host start <

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

Azure Functions Core Tools (2.3.199 Commit hash: fdf734b09806be822e7d946fe17928b419d8a289) Function Runtime Version: 2.0.12246.0 Skipping 'AzureWebJobsStorage' from local settings as it's already defined in current environment variables. [12/26/2018 11:50:35 PM] Starting Rpc Initialization Service. [12/26/2018 11:50:35 PM] Initializaing RpcServer [12/26/2018 11:50:35 PM] Building host: startup suppressed:False, configuration suppressed: False [12/26/2018 11:50:35 PM] Reading host configuration file 'C:\Git\myfirstazurefunc\bin\Debug\netcoreapp2.1\host.json' [12/26/2018 11:50:35 PM] Host configuration file read: [12/26/2018 11:50:35 PM] { [12/26/2018 11:50:35 PM] "version": "2.0" [12/26/2018 11:50:35 PM] } [12/26/2018 11:50:35 PM] Initializing Host. [12/26/2018 11:50:35 PM] Host initialization: ConsecutiveErrors=0, StartupCount=1 [12/26/2018 11:50:35 PM] Starting JobHost [12/26/2018 11:50:35 PM] Starting Host (HostId=seavxmobdev02-1148883587, InstanceId=effee630-cfe6-417b-ab26-dd7291e7f048, Version=2.0.12246.0, ProcessId=4848, AppDomainId=1, InDebugMode=False, InDiagnosticMode=False, FunctionsExtensionVersion=) [12/26/2018 11:50:35 PM] Loading functions metadata [12/26/2018 11:50:35 PM] 1 functions loaded [12/26/2018 11:50:35 PM] WorkerRuntime: dotnet. Will shutdown other standby channels [12/26/2018 11:50:35 PM] Generating 1 job function(s) [12/26/2018 11:50:36 PM] Error indexing method 'HttpTriggerCSharp.Run' [12/26/2018 11:50:36 PM] Microsoft.Azure.WebJobs.Host: Error indexing method 'HttpTriggerCSharp.Run'. Microsoft.Azure.WebJobs.Host: Cannot bind parameter 'log' to type ILogger. Make sure the parameter Type is supported by the binding. 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.).

Additional context

Add any other context about the problem here. Include the output of dotnet --info

jordanchang avatar Dec 27 '18 00:12 jordanchang

@jordanchang This issue should be filed on Azure functions. Is there's a reason you're trying to use the 2.2 Http package instead of using the one that comes with functions? cc @fabiocav

davidfowl avatar Dec 27 '18 00:12 davidfowl

@davidfowl you're right, there is one already as part of asp .net core. I'm not sure why I missed it and why Visual Studio couldn't help me find it at first. Unfortunately, the Azure Functions SDK doesn't include it.

closing and will re-open under azure function.

jordanchang avatar Dec 27 '18 01:12 jordanchang