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

req.context.invocationId #6

Closed
espray opened this issue Apr 25, 2017 · 5 comments
Closed

req.context.invocationId #6

espray opened this issue Apr 25, 2017 · 5 comments
Assignees

Comments

@espray
Copy link

espray commented Apr 25, 2017

Can the invocationId made available through req.context?

@yvele
Copy link
Owner

yvele commented Apr 25, 2017

@espray I think I should make the whole context object available.. What do you think?

@yvele yvele self-assigned this Apr 25, 2017
@espray
Copy link
Author

espray commented Apr 25, 2017

I thought that at first, but that might be problematic.
If context.done() was called it would mess with the express flow.
context.bindings are mapped to the express.Request and express.Response params.

The safe play is log and invocationId only

Also, here is my Typescript declaration file azure-function-express.d.ts

import * as express from 'express';

export interface AzureFunctionExpressRequest extends express.Request {
  context: {
    invocationId: string;
    log(message: any): void;
  }
}

@yvele
Copy link
Owner

yvele commented Apr 27, 2017

@espray I don't like whitelisting and sometimes prefer giving responsibilities to developers but in this case yep I will explicitly add invocationId

But hum.. I can't find context.contextId in any Azure documentation or via a Google search. Can you point me to the doc?

@espray
Copy link
Author

espray commented Apr 27, 2017

Yup I agree on giving full responsibilities to developers.

`context.invocationId'
https://github.com/christopheranderson/azure-functions-typescript
You could ask Christopher, his git profile says he is a Microsoft PM - Azure.

@yvele
Copy link
Owner

yvele commented May 2, 2017

@espray I've published a new patch v1.2.2 to NPM ;)

@yvele yvele closed this as completed May 2, 2017
yvele added a commit that referenced this issue Oct 15, 2017
Expose context bindings in Request object

Related to #6
yvele added a commit that referenced this issue Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants