Skip to content
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

Route parameters in the binding don't appear to work #19

Open
levidrain opened this issue Jul 31, 2020 · 2 comments
Open

Route parameters in the binding don't appear to work #19

levidrain opened this issue Jul 31, 2020 · 2 comments

Comments

@levidrain
Copy link

I was experimenting with this. After running denofunc init and I changed the hello_world file like below. As far as I can tell, route parameters aren't passed into the function. Am I missing something?

import { AzureFunctionsContext } from "../deps.ts";

async function handler(context: AzureFunctionsContext) {
  context.res = {
    status: 200,
    body: `${context.bindingData.category}/${context.bindingData.id}`
  };
}

export default {
  handler,

  // Name of the function
  name: "hello_world",
  metadata: {
    bindings: [{
      type: "httpTrigger",
      name: "req",
      direction: "in",
      methods: ["get"],
      route: "products/{category:alpha}/{id:int?}"
    }, {
      type: "http",
      name: "res",
      direction: "out"
    }]
  }
  // By default, it's an HTTP function. For other functions, add a `metadata` property
  // with the contents of function.json that describes the trigger and bindings.
  // https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-example
};
@anthonychu
Copy link
Owner

I think this might be related to this regression here but not entirely sure. Azure/azure-functions-host#6305

@pragnagopa do you know the progress of this fix and when it might land in Core Tools and Azure?

@pragnagopa
Copy link

Yes. This is due to a regression. Fix will be rolling out next week and core tools will be updated ~2 weeks from now.
Until then please pin runtime version to : 3.0.13353 . Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants