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

Add support for customHandler section in host.json #6064

Merged
merged 4 commits into from
Jun 8, 2020

Conversation

pragnagopa
Copy link
Member

@pragnagopa pragnagopa commented May 20, 2020

This PR adds support to specify custom handler section in host.json as discussed in #6080

  • Here is an example host.json that specifies workingDirectory
{
	"version": "2.0",
	"extensionBundle": {
		"id": "Microsoft.Azure.Functions.ExtensionBundle",
		"version": "[1.*, 2.0.0)"
	},
	"customHandler": {
		"description": {
			"defaultExecutablePath": "dotnet",
			"workingDirectory": "CSharpCustomHandlers/bin/Debug/netcoreapp2.2",
			"arguments": [ "CSharpCustomHandlers.dll" ]
		},
                "enableForwardingHttpRequest": true
	}
}
  • Environment variables can be specified as part of any element in description following the format
    %EnvVarName%. Here is an example
{
	"version": "2.0",
	"customHandler": {
		"type": "http",
		"enableForwardingHttpRequest": false,
		"description": {
			"defaultExecutablePath": "%GoWorkerEnv%",
			"arguments": [
				"%FUNCTIONS_CUSTOMHANDLER_PORT%"
			]
		}
	}
}
  • Each element in description can also be overridden via EnvVars/AppSettings. Here is an example of AppSetting / Environment variable name to overrride arguments element
    AzureFunctionsJobHost:customHandler:description:arguments

Fixes #5692, Fixes #5921, Fixes #5547, Fixes #6080, Fixes #5882, Fixes #5615

Note: httpWorker section will be deprecated sometime later. For now, it is still supported.

@pragnagopa pragnagopa requested a review from yojagad May 20, 2020 02:08
yojagad
yojagad previously approved these changes May 21, 2020
Copy link
Contributor

@yojagad yojagad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@anthonychu
Copy link
Member

Can we please hold off on this while we discuss #6020? Thanks.

@pragnagopa
Copy link
Member Author

Can we please hold off on this while we discuss #6020? Thanks.

Yes. I will hold off. Added comments in referenced issue. This PR would still be needed to support env vars in the existing config.

Copy link
Member

@fabiocav fabiocav left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couple of comments from a brief look.

@pragnagopa pragnagopa force-pushed the pgopa/httpWorker/expandEnv branch from e478325 to fcac40e Compare June 1, 2020 15:22
@pragnagopa pragnagopa changed the title [HttpWorker]Add support to expand env variables in HttpWorkerConfig Add support for customHandler section in host.json Jun 1, 2020
@pragnagopa
Copy link
Member Author

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

yojagad
yojagad previously approved these changes Jun 2, 2020
Copy link
Contributor

@yojagad yojagad left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@pragnagopa
Copy link
Member Author

@yojagad - can you please take quick a look again as I had to resolve few merge conflicts

@pragnagopa
Copy link
Member Author

pragnagopa commented Jun 5, 2020

@fabiocav - can you please take a look at the config customhandler options ? It would be good to to get this PR in for the next release.

@yojagad
Copy link
Contributor

yojagad commented Jun 5, 2020

That was the only comment I had. Rest looks good!

@pragnagopa pragnagopa merged commit b79be74 into dev Jun 8, 2020
@pragnagopa pragnagopa deleted the pgopa/httpWorker/expandEnv branch June 8, 2020 23:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment