I can create an Azure Functions project (V2) – Python 3.11
After publishing all functions work – they all work on my local dev laptop – however there is one function that does not work when hosted as an Azure Function.
papermill ..
I have the python file downloaded, I can verify that it is in the tmp folder where the Azure Function downloads the file, as well as I have the metadata file there < – same as when debugging locally.
however, when i call execute_notebook function in papermill I get this error immediately?
Kernel died before replying to kernel_info
what does this mean? and how can I make this work when running on Azure Function hosted?
2
Answers
I managed to make Papermill work by installing the kernel each time the function starts up - since I want to keep on using Azure Serverless (consumption plan):
Here is a more detailed flow, of some of the key elements, which allow me to download notebooks from kaggle, run them in azure serverless function and then push them back to Kaggle, tested it and it is working ;-)
remember to configure KAGGLE_USERNAME and KAGGLE_KEY with your API in local.settings.json - and ALSO in your Azure Functions Project Config in the Portal - or your functions won't show up online until you add those two configuration keys and values.
You need to install the kernel by visiting
Advance tool kudu
andSSH'ing
into Azure Function app. Make sure you have created your Azure Function app in Premium or Dedicated app service plan for the ssh to work:-My function app kudu ssh commands to install kernel:-
Azure function app > Development Tools > Advanced Tools > Go:-
My Function app code:-
Refer my SO answer for the same error.