I am busy with a demo application to show the power of Cloud Functions in general and specific Spring Cloud Function.
I was already able to deploy the Demo application on IBM Cloud, next step is to run in it on Azure.
Prepare the application
I found a very good article by Microsoft which explain how to prepare your Spring Cloud Function application before it can be deployed to Azure.
First run it locally
After the preparations I tried to run the application locally. Microsoft did a great job to make this possible. Helps speed up the development of the application before the actual deployment.
But when I tried to run the application locally it failed with a stack trace. After some searching on the internet I found the solution.
I need to the Main Class to the local.settings.json file, which point to the start class of the application. After I added this line I was able to run my demo application locally.
{
"IsEncrypted": false,
"Values": {
"AzureWebJobsStorage": "",
"FUNCTIONS_WORKER_RUNTIME": "java",
"AzureWebJobsDashboard": "",
"MAIN_CLASS":"nl.elstarit.nl.demo.functions.demo.DemoFunction"
}
}
The last step, the actual deployment to Azure was very easy.