On the Progress Corticon team, we love serverless technologies. This blog is the third in a series on serverless. If you are interested in AWS Lambda functions you can get started with this post on creating your first serverless/Lambda functions. Or if you are interested in Azure function you can get started with this post https://www.progress.com/blogs/how-to-create-your-first-serverless-functions-on-microsoft-azure
If you do not have an account on GCP, you can simply create one for free. See https://cloud.google.com/free to get started.
Once you are logged into your account, click on the navigation menu at the top left:
And scroll down to the “Compute” section and click on “Cloud Functions.”
Then click create and enter a function name.
Click on “Save” and later click on “Next”. You will now be on the code screen.
Click “Deploy.” This may take a while. Wait until you see the green checkmark as in the following screen.
Once you get the green checkmark, click on the Actions and from the list that appears click on “Test Function.”
This will lead to the following screen:
Click on “TEST THE FUNCTION” button, and you will get the following result at the bottom of the screen:
Congratulations, you have now run your first Google Cloud function. However, we didn't pass any data to the function. In the next section, we will learn how to use data from the input event.
Click on “Test the Function” as we did earlier and enter a specific JSON payload like this:
"message": "this is my own data"
And click on run again. We will get:
You should now look at the code and see how the sample accesses the message property and returns it as part of the result. Observe how the result is returned via the response object.
Note how there is no way to save the JSON payload or create multiple test payloads as we can in AWS Lambda. This is a bit annoying and we hope Google will soon fix this.
Congratulations, you have now run your first GCP function. As you can see it is very simple and you didn’t have to do anything to get a function that automatically scale based on the load and most importantly you did not need to provision and manage a set of servers to handle the load.
Subscribe to get all the news, info and tutorials you need to build better business apps and sites
You have the right to request deletion of your Personal Information at any time.
You can also ask us not to pass your Personal Information to third parties here: Do Not Sell My Info
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.