-
Notifications
You must be signed in to change notification settings - Fork 21.1k
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
Python instructions for warmup function are erronous #62804
Comments
@ncoder Thank you for your feedback! We will review and update as appropriate. |
@ncoder For the exception can you please verify if your function have name "warmupContext" for your warmup trigger function and function.json as below. As per the error message the name is define in function.json doesn't match what you have define. I have tested it at my end and couldn't observe the same behaviour. def main(warmupContext: func.Context) |
My apologies. I pasted an error message from a run of something else I had tried. I changed my code as above (and as documented) and saw again the original error that I wanted to bring to your attention. Worker failed to function id 081eef2a-1db2-43c4-98a1-8a58ec83b845.
Result: Failure
Exception: FunctionLoadError: cannot load the warmup function: type of warmupContext binding in function.json "warmupTrigger" does not match its Python annotation "Context"
Stack: File "/usr/local/Cellar/azure-functions-core-tools@2/2.7.2883/workers/python/3.7/OSX/X64/azure_functions_worker/dispatcher.py", line 269, in _handle__function_load_request
function_id, func, func_request.metadata)
File "/usr/local/Cellar/azure-functions-core-tools@2/2.7.2883/workers/python/3.7/OSX/X64/azure_functions_worker/functions.py", line 219, in add_function
f'type of {param.name} binding in function.json ' this is from simply running "func start" from the command line PYTHONPATH=`pwd` func start To recap, of relevance here,i have: import logging
import azure.functions as func
def main(warmupContext : func.Context) -> None:
logging.info("WARMUP START")
logging.info("WARMUP COMPLETE") warmup/function.json {
"scriptFile": "azfwarmup.py",
"bindings": [
{
"type": "warmupTrigger",
"direction": "in",
"name": "warmupContext"
}
]
}
|
This may be of importance. I'm running on a mac with Python 3.7.9. |
@ncoder Thanks for your response. I was able to repro the issue at my local machine and have reached out to my team. Will be updating this thread once I heard back from my team. |
@ncoder Apology for the delay. I got confirmation from the product team that the warmup trigger is only available to apps running on the Premium plan. The same is mentioned in the document. You can test it premium plan and if you still facing the issue you can always reach out to azure support. Please let me know if you have any concerns. |
I should be running on the premium plan.
…On Mon, Oct 5, 2020, 02:54 MayankBargali-MSFT ***@***.***> wrote:
@ncoder <https://github.com/ncoder> Apology for the delay. I got an
update from my team that warmup trigger is only available to apps running
on the Premium plan. The same is mentioned in the document
<https://docs.microsoft.com/en-us/azure/azure-functions/functions-bindings-warmup?tabs=csharp#trigger---limits>.
You can test it premium plan and if you still facing the issue you can
always reach out to azure support. Please let me know if you have any
concerns.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#62804 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAKFINWBWLPUZZ2KTHM5C3LSJGJWDANCNFSM4RP2YZRQ>
.
|
@ncoder We will now proceed to close this thread. If there is any issue testing the premium plan feel free to open an azure support ticket or post your issue on Microsoft Q&A |
I was also running into this issue on a Premium plan that is. It's a type error so my easy dirty fix was to remove the type definition altogether. Works like a charm.
|
It seems this is still an issue? Edit: can confirm, still an issue as of 2024-03-20. |
Following these instructions leads to this error.
It seems that the type specified in the function.json file does not match the annotation on the snippet.
I don't know what the right answer is, but I've managed to seemingly continue here by stripping the type info on the function.
Further feedback, while you're in there. The documentation states that the warmup function must be called "warmup" (case insensitive); I think this is pretty clear in C#, but a little less clear with python. (I understood that i need to make a module/folder called "warmup")
Document Details
⚠ Do not edit this section. It is required for docs.microsoft.com ➟ GitHub issue linking.
The text was updated successfully, but these errors were encountered: