We have an HTTP triggered Cloud Function that has permissions set up via IAM. From our Python App Engine, how do we invoke the cloud function using a GCP Service Account?
Using the cloud functions service, we are able to call:
functions_service.projects().locations().functions().call(name=function_name)
This works, as the service adds the Bearer Authentication HTTP header. However, according to the docs (here and here), using the call() method to invoke the cloud function means we have a strict rate limit of 16/100s which is not suitable for production.
If we try calling the cloud function directly, via the https://[region]-[projectId].cloudfunctions.net/[functionName] URL, it does not authenticate (responds with 401), even with the Bearer Authentication HTTP header described above.