-
Notifications
You must be signed in to change notification settings - Fork 469
Move Proxies to .Net Standard 2.0 for Functions V2. #2425
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
Conversation
{ | ||
get | ||
{ | ||
return string.Equals(Environment.GetEnvironmentVariable(EnvironmentSettingNames.AzureWebJobsDisableHomepage), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would prefer this to be done via IConfiguration approach so we're not locked to environment variables as the only method of setting this.
|
||
if (rc.RouteData != null && rc.RouteData.DataTokens != null) | ||
{ | ||
functionName = rc.RouteData.DataTokens["AZUREWEBJOBS_FUNCTIONNAME"].ToString(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: should avoid string literals and use a constant
20f08b0
to
05ba82f
Compare
hi Any idea when this might make it onto azure portal? really need proxies to be working, but I can get by if could have some idea if this will be resolved within the next month or so at least? many thanks |
Yes it should be. Waiting for some code reviews. |
5844da0
to
5a88149
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a quick look (with you :) ) and left some notes
result = await GetResultAsync(context, functionExecution); | ||
|
||
// TODO: need some cleanup | ||
if (nestedProxies != null && int.Parse(nestedProxies.ToString()) > 0) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is this here?
IFunctionExecutionFeature functionExecution = context.Features.Get<IFunctionExecutionFeature>(); | ||
|
||
object nestedProxies; | ||
context.Items.TryGetValue("X_MS_NestedProxyCount", out nestedProxies); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this?
return; | ||
} | ||
} | ||
else if (functionExecution == null |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe move this to its own middleware? (e.g. HomepageMiddleware
), in the future, that also gives us the ability to inspect the flag early and not register the logic.
foreach (var router in route.Routers) | ||
{ | ||
var webJobsRouter = router as WebJobsRouter; | ||
if (webJobsRouter != null) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: (router is WebJobsRouter webJobsRouter)
|
||
FunctionInvocationMiddleware functionInvocationMiddleware = new FunctionInvocationMiddleware(null); | ||
|
||
// TODO: need some cleanup |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still need this?
httpContext.Items.Remove("X_MS_ReverseRoutes"); | ||
httpContext.Items.Remove(ScriptConstants.AzureFunctionsHostManagerKey); | ||
|
||
await rc.Handler.Invoke(httpContext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Handler could potentially be null
here, right?
28f29ad
to
8b63b9d
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small comment. Can you just update that and ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should be able to move this block to the above if
block. result
should also never be null
.
Does this mean proxies now work in v2 functions, or are there more things to do (e.g. a new release)? Where will the availability be announced (so I don't need to keep asking)? Thanks! |
@JonathanGiles Yes they will work with our next release of Functions V2. We usually have a release every couple of weeks. |
work in progress...