Hi there, hope someone can give me some guidance. How do I upgrade 1st gen cloud function to 2nd gen? What do i need to do?
We've been inform to ensure that Artifact Registry API is enabled, or explicitly set the image registry setting back to GCR to continue deploying 1st gen Cloud Functions after January 15, 2024. No action is required if the Artifact Registry is already enabled on your project. GCR will continue to be supported as a non-default option. Additional details about this transition will also be published in our release notes page
Currently the workflows is once GA4 raw data daily loads into BigQuery, the certain daily log will be routed to pub/sub topic. The pub/sub topic triggers a Cloud Function gen 1 and the function will run a scheduled query. I'm using Simo's blog example. https://www.teamsimmer.com/2022/12/07/how-do-i-trigger-a-scheduled-query-when-the-ga4-daily-export-h...
how do i upgrade from gen1 to gen2? What do i need to implement?
Gen2 function will require enabling Artifact Registry API. Do i only enable the API or do i create a gen2 function and copy gen1 source code to gen2 one. Do i use the same version of source code (Python / nodejs etc...) ?
thanks in advance
Hi @sysph,
Welcome to Google Cloud Community!
We don't have a direct way to "upgrade" Google Cloud Functions from 1st gen to 2nd gen. We need to deploy a new Cloud Functions by selecting 2nd gen for the Environment (when deploying on cloud console) and adding --gen2 flag (when deploying on gcloud).
Gen 2 only requires Artifact Registry. You can still use your old code. The only difference is how you deploy your function.
You may follow these documentations below on how to deploy a function on gen 2 Cloud Functions:
The aforementioned links also contain Cloud Functions version comparison and Console Quickstart for Cloud Functions (1st gen).
Hope this helps.