How to setup Google Cloud Scheduler job triggering your Cloud Function

In this story, we are covering how to setup google cloud scheduler job that triggers (HTTP) your cloud function with Authentication.

It allows you to schedule virtually any job, including batch, big data jobs, cloud infrastructure operations, and more. You can automate everything, including retries in case of failure. It allowing you to manage all your automation tasks from one place.

Let’s start,

Step 1 : In the Cloud Console, go to the Cloud Scheduler page:

Step 2 : Click Create Job.

Step 3: Set the name and description under “Define the schedule “

Name example,my-new-job

Step 4 : Set Frequency and Timezone.

Frequency example, */5 * * * *

It will run job every 5 minutes. The interval is defined using unix-cron format.

Timezone example, select United States and Los Angeles or Pacific Daylight Time (PDT).

Step 5 : Press Continue button

Step 6 : Select Target type as HTTP and paste cloud function URL then select HTTP method.

Step 7 : Set HTTP headers

For example, Name: User-Agent and Value: Google-Cloud-Scheduler

Step 8 : Set Auth header, as OIDC token or OAuth token.

Enter the service account you previously created(it will in the credentials json file downloaded from cloud console)

For example, sa-name@PROJECT_ID.iam.gserviceaccount.com

Step 9 : Press Continue button

Step 10 : Configure the job’s retry (optional)

if you want retry , you can set its optional.

Step 11 : Hit Create button

The job will create and you can run ,test and view logs from dashboard.

By selecting view log, it will re-direct in to Logs Explorer and you can view logs by selecting specific time ranges.

--

--

--

Software Developer

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

The truth is that you should expect a lot of WORK to happen in the beginning. But I

How To Add the Android In-App Review API to Improve Ratings

Python program to check if two strings are anagram or not

Introduction to FinOps for Kubernetes: Challenges and Best Practices

How to Make a Serverless Solution for a Charity for $12* a Year

What is SyncTree? SyncTree 9 Q&A

How to convert an MSG Outlook File to HTML String in C# .NET Framework

Hack The Box — Book

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Suman Dev

Suman Dev

Software Developer

More from Medium

Top KPIs for Insurance Effective Dashboards | Saxon AI

GCP Data Fusion — Create a Cloud SQL PostgreSql Connection

Flight Tracking Data — Where to Get It

How to improve operations with data monitoring and data matching