Hello Guys,
I am wondering why my gen2 cloud function cannot be found on my load balancer. I get a 404 response when I try to call it from my static website, which is deployed on the same load balancer.
The exact same setup works properly with a gen1 cloud function.
On my load balancer, I create a network endpoint group:
Solved! Go to Solution.
Cloud Functions of 2nd generation are deployed as Cloud Run services. Given this, you could try creating your NEG using the --cloud-run-service flag instead.
Keep in mind the service must also be in the same project and region as the Network Endpoint Group.
You could also check this guide which deploys a 2nd gen. Cloud Function in a load balancer, and does so using it as a Cloud Run service.
Cloud Functions of 2nd generation are deployed as Cloud Run services. Given this, you could try creating your NEG using the --cloud-run-service flag instead.
Keep in mind the service must also be in the same project and region as the Network Endpoint Group.
You could also check this guide which deploys a 2nd gen. Cloud Function in a load balancer, and does so using it as a Cloud Run service.
Thanks a lot, simply changing "--cloud-function-name" to "--cloud-run-service" fixed the issue.