Get hands-on experience with 20+ free Google Cloud products and $300 in free credit for new customers.

Is it possible to change the default service account for cloud build

I am looking to see if it is possible to change the default service account for cloud build.

I am referring to the default in cloud build settings, as opposed to selecting a different service account by trigger.

I have been successfully executing builds using the default however have recently been asked to create a custom service account. My platform team have created the account but removed the default account.

Builds are now not executing.

0 2 4,786
2 REPLIES 2

Hi @sean-conkie,

Welcome to Google Cloud Community!

In this documentation it says:

This page explains how to configure user-specified service accounts for builds.

By default, Cloud Build uses a special service account to execute builds on your behalf. This service account is called the Cloud Build service account and it is created automatically when you enable the Cloud Build API in a Google Cloud project. This service account has a number of permissions by default such as the ability to update builds or write logs.

Instead of using the default Cloud Build service account, you can specify your own service account to execute builds on your behalf. You can specify any number of service accounts per project. Maintaining multiple service accounts enables you to grant different permissions to these service accounts depending on the tasks they perform. For example, you can use one service account for building and pushing images to the Container Registry and a different service account for building and pushing images to Artifact Registry.


You may follow that documentation to specify your own service account.

Reference:

Thanks

Can we change a default cloud build service account from UI?