New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Functions v2 - Cannot bind parameter 'log' to type TraceWriter #900

Closed
richardrobberse opened this Issue Jul 30, 2018 · 5 comments

Comments

Projects
None yet
3 participants
@richardrobberse
Copy link

richardrobberse commented Jul 30, 2018

Whenever I call my published azure function it results in the following error:
Cannot bind parameter 'log' to type TraceWriter. Make sure the parameter Type is supported by the binding.
The same happens if I use the ILogger instead of the TraceWriter, am I missing something?

Error indexing method 'GetScriptsDownloadUri.Run'
Microsoft.Azure.WebJobs.Host, Version=2.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35

Investigative information

  • Timestamp: 2018-07-25T19:35:04.560
  • ProblemId: System.InvalidOperationException at Microsoft.Azure.WebJobs.Host.Indexers.FunctionIndexer+d__20.MoveNext
  • Function App version: 2.0-beta
  • Function App name: navbaasbuildapi-test
  • Function name(s) (as appropriate): GetScriptsDownloadUri
  • Invocation ID: N.A.
  • Region: West Europe

Repro steps

Standard HTTP Trigger function with the following signature:

public static async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Function, "get", Route = null)]HttpRequest req, TraceWriter log)
@brettsam

This comment has been minimized.

Copy link
Member

brettsam commented Jul 31, 2018

This often happens due to a version mismatch between what you're running locally and what you're running when deployed.

It looks like you may be building a functions v2.0 applicaiton locally, but you're deploying to a functions v1.0 site (I see your site is using v1.0.11913.0).

@richardrobberse

This comment has been minimized.

Copy link

richardrobberse commented Jul 31, 2018

oh that's weird, thanks for the hint, I'll look into the deployment!

@richardrobberse

This comment has been minimized.

Copy link

richardrobberse commented Jul 31, 2018

You're completely right, how did I miss that eh?
Thanks again 👍

@timmyreilly

This comment has been minimized.

Copy link

timmyreilly commented Sep 5, 2018

How do you recommend configuring the Site Version? When I push to Azure it defaults to v1 and in the Function App Settings won't let me change Runtime Version: "Cannot Upgrade with Existing Functions Major Version upgrades can introduce breaking changes..." But if I create another function app I can't push to it... "please change the version using the the portal or update your FUNCTION_EXTENSION_VERSION appsetting and retry..." I'm able to build and test locally... Any ideas?

This helped: #667 (comment)

@richardrobberse

This comment has been minimized.

Copy link

richardrobberse commented Sep 5, 2018

I've initially created the function app in Azure as v2 and I push to it from a VSTS release so pushing to it should definitely be possible, however I can't help you with how to do it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment