Search code examples
google-cloud-platformgoogle-cloud-functionsservice-accounts

Google Function service account


I'm trying to deploy a function to Google Function running as a different service account other than the default "PROJECT_ID"@appspot.gserviceaccount.com.

Is this even possible?

What I've tried until now is:

  1. Auth as the service account and run the deploy command
  2. Auth as the service account and run the deploy command using "--account"

The functions keep getting deployed with the default serviceAccount.

Thanks

EDIT (2019/02/13):

As stated by @JJC, This is now available via gcloud beta features via:

gcloud beta functions deploy ... --service-account=$YOUR_SA_HERE

EDIT (2023/07/06): As stated by @TinyTiger this is now GA: see the response here


Solution

  • This is now available via gcloud beta features:

    gcloud beta functions deploy ... --service-account=$YOUR_SA_HERE