Demo of how to setup and deploy Google Cloud function using Python
View Demo »
This project demonstrates how to deploy a cloud function on Google Cloud.
- Open the Google Cloud website and create an account.
- Create a billing account and activate billing.
- Create a new project.
- Open Cloud Functions from the hamburger menu or using the search.
- Click on CREATE FUNCTION.

- Add a function name and choose a region.
- Click on
Allow unauthenticated invocations.

- Open Runtime, build, connections and security settings by clicking on the down arrow.
- Under autoscaling change the
Minimum number of Instancesto 0 andMaximum number of Instancesto 2.
- Click on NEXT.
- Choose the runtime as
Python 3.9. - Copy the code from
cloud-function.pyand paste it into themain.pyfile. - Copy the requirements from
requirements.txtand paste it into therequirements.txtfile. - Click on DEPLOY.

- It usually takes 1-2 minutes deploy the function. Once deployed you will get a URL to trigger the function.
- You can test the function using this URL by adding
?link=https://yourlink.com
https://us-central1-project-name.cloudfunctions.net/function-2?link=https://yourlink.com
- You can integrate the link in your app. Check the
main.pyfor an example.
Distributed under the MIT License. See LICENSE.txt for more information.
Project Link: https://github.com/pratikkalein/cloud-function-demo
Demo Link : http://pratik.tech/gcf-demo