Open bmcandr opened 1 week ago
Hi @bmcandr Thanks for reporting We are investigating on this will update you the findings soon.please share the pex files( test_pex ) function with version for reference.
Sure. We actually use the Pants build system to produce our PEX. The error first appeared after we upgraded to v2.20 (which uses PEX v2.1.163).
Here is a PEX generated with Pants v2.19/PEX v2.1.148 that does not produce the error after zip-deploying as a Function App:
And here is a PEX produced with Pants v2.20/PEX v2.1.163 that DOES produce the error I reported:
You can view the contents of the entrypoint script, function.json, etc. files with
unzip -p test-pex-2.21.zip test_pex/__init__.py | cat
And here is an operation ID of a failed invocation in case it is helpful: 9ffa9cc2b7bfef52681158d54baad524
.
This resulted in Executed 'Functions.test_pex' (Failed, Id=68381973-088e-4058-9c00-1d48fb4b4a91, Duration=11ms)
Expected Behavior
The Function should execute without error.
Actual Behavior
The Function fails with an error message saying that the type of the input binding in
function.json
does not match the Python type annotation of the parameter in the entrypoint function.Steps to Reproduce
Using Python version 3.10.*:
host.json
andfunction.json
)az functionapp deployment source config-zip --src example.zip --build-remote false --name myfunc --resource-group myresourcegroup --verbose
)Relevant code being tried
The v1 programming model example from the Azure docs here.
Relevant log output
requirements.txt file
Where are you facing this problem?
Production Environment (explain below)
Additional Information
This error began occurring in my deployed Functions without any changes to code or dependencies. I have also seen this error in a handful of failed invocations of Functions that otherwise execute without error.
I replicated the error with the example Function found on the docs page for Azure Event Grid trigger for Azure Functions.
I can "fix" this error by removing the
func.EventGridEvent
type annotation from themain
entrypoint function definition. A similar issue was raised several years ago.