Question 684 of 999
Deploying applicationsmediumMultiple ChoiceObjective-mapped

Fix Cloud Build PERMISSION_DENIED for Cloud Function Deployments

This PCD practice question tests your understanding of deploying applications. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.

A team uses Cloud Build to automatically deploy a Cloud Function on push to a repository. The build fails intermittently with 'PERMISSION_DENIED' when executing gcloud functions deploy. What is the most likely cause?

Clue words in this question

Noticing these words before you look at the options changes how you read each choice.

  • Clue: "most likely"

    Why it matters: Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.

Quick Answer

The answer is that the Cloud Build service account lacks the necessary IAM permissions on the Cloud Functions API, specifically the Cloud Functions Developer role. This is the most likely cause of an intermittent PERMISSION_DENIED error when deploying Cloud Functions because Cloud Build uses its default compute engine service account to execute builds, and that account must be granted the roles/cloudfunctions.developer role to invoke the gcloud functions deploy command. On the Google Professional Cloud Developer exam, this tests your understanding of service account impersonation and least-privilege IAM design, often appearing as a trap where candidates blame repository triggers or syntax errors. A common memory tip is to remember that Cloud Build is just a pipeline—it needs explicit permission to touch Cloud Functions, just like any other user. Think "Build needs Build-in permission to Function."

Answer choices

Why each option matters

Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.

Correct answer & explanation

The Cloud Build service account lacks the necessary IAM permissions on the Cloud Functions API.

The intermittent 'PERMISSION_DENIED' error when Cloud Build runs `gcloud functions deploy` indicates that the Cloud Build service account does not have the required IAM roles (e.g., Cloud Functions Developer or Cloud Functions Admin) on the Cloud Functions API. Cloud Build uses its default compute engine service account (or a user-specified service account) to execute build steps; if this account lacks the `cloudfunctions.functions.create` or `cloudfunctions.functions.update` permission, the deployment will fail, and the intermittent nature may be due to eventual consistency or race conditions in IAM propagation.

Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • The region specified in the build configuration does not match the function's region.

    Why it's wrong here

    That would cause a different error.

  • The build configuration file has a syntax error.

    Why it's wrong here

    Syntax errors would fail earlier.

  • The Cloud Source Repository does not have the correct triggers.

    Why it's wrong here

    Triggers are set up correctly if build starts.

  • The Cloud Build service account lacks the necessary IAM permissions on the Cloud Functions API.

    Why this is correct

    Cloud Build requires roles/cloudfunctions.developer to deploy functions.

    Clue confirmation

    The clue word "most likely" in the question point toward this answer.

    Related concept

    Read the scenario before looking for a memorised answer.

Common exam traps

Common exam trap: answer the scenario, not the keyword

Candidates often confuse build trigger configuration issues with runtime permission errors, leading them to incorrectly select options related to trigger misconfiguration when the error occurs during the deployment step itself. The intermittent 'PERMISSION_DENIED' points to IAM permissions for the Cloud Build service account on the Cloud Functions API.

Detailed technical explanation

How to think about this question

Under the hood, Cloud Build executes steps using the service account specified in the build config or the project's default compute engine service account (PROJECT_NUMBER-compute@developer.gserviceaccount.com). This account must have the `cloudfunctions.functions.create` and `iam.serviceAccounts.actAs` permissions on the Cloud Functions runtime service account. The intermittent nature can occur if IAM roles are assigned via a custom role that is still propagating, or if the service account is used across multiple builds and hits a quota or caching issue. In real-world scenarios, this often happens when a team uses a shared project and the Cloud Build service account is not explicitly granted the Cloud Functions Developer role.

KKey Concepts to Remember

  • Read the scenario before looking for a memorised answer.
  • Find the constraint that changes the correct option.
  • Eliminate answers that are true in general but not in this case.

TExam Day Tips

  • Watch for words such as best, first, most likely and least administrative effort.
  • Review why wrong options are wrong, not only why the correct option is correct.

Key takeaway

Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.

Real-world example

How this comes up in practice

A company's IT admin needs to give a contractor read-only access to production logs without sharing account credentials. Using role-based access control (RBAC) and temporary scoped permissions — not a permanent shared password — is the correct pattern. Questions like this test whether you can apply least-privilege access across cloud identity services.

Quick reference

Cloud Service Model Comparison

ModelYou ManageProvider ManagesExamples
IaaSOS, runtime, apps, dataHardware, hypervisor, networkingEC2, Azure VMs, GCP Compute Engine
PaaSApps and dataOS, runtime, middleware, hardwareElastic Beanstalk, Azure App Service
SaaSData and settings onlyEverything elseMicrosoft 365, Salesforce, Workday
FaaS / ServerlessFunction code onlyInfra, scaling, runtimeLambda, Azure Functions, Cloud Run
CaaSContainers and appsKubernetes, OS, hardwareEKS, AKS, GKE

What to study next

Got this wrong? Here's your next step.

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Related practice questions

Related PCD practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Manage a Solution that Can Span Multiple Database Systems practice questions

Practise PCD questions linked to Manage a Solution that Can Span Multiple Database Systems.

Deploy Scalable and Highly Available Databases in Google Cloud practice questions

Practise PCD questions linked to Deploy Scalable and Highly Available Databases in Google Cloud.

Design Scalable and Highly Available Cloud Database Solutions practice questions

Practise PCD questions linked to Design Scalable and Highly Available Cloud Database Solutions.

Migrate Data Solutions practice questions

Practise PCD questions linked to Migrate Data Solutions.

Designing highly scalable, available, and reliable cloud-native applications practice questions

Practise PCD questions linked to Designing highly scalable, available, and reliable cloud-native applications.

Building and testing applications practice questions

Practise PCD questions linked to Building and testing applications.

Deploying applications practice questions

Practise PCD questions linked to Deploying applications.

Integrating Google Cloud services practice questions

Practise PCD questions linked to Integrating Google Cloud services.

Managing application performance monitoring practice questions

Practise PCD questions linked to Managing application performance monitoring.

PCD fundamentals practice questions

Practise PCD questions linked to PCD fundamentals.

PCD scenario practice questions

Practise PCD questions linked to PCD scenario.

PCD troubleshooting practice questions

Practise PCD questions linked to PCD troubleshooting.

Practice this exam

Start a free PCD practice session

Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.

FAQ

Questions learners often ask

What does this PCD question test?

Deploying applications — This question tests Deploying applications — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: The Cloud Build service account lacks the necessary IAM permissions on the Cloud Functions API. — The intermittent 'PERMISSION_DENIED' error when Cloud Build runs `gcloud functions deploy` indicates that the Cloud Build service account does not have the required IAM roles (e.g., Cloud Functions Developer or Cloud Functions Admin) on the Cloud Functions API. Cloud Build uses its default compute engine service account (or a user-specified service account) to execute build steps; if this account lacks the `cloudfunctions.functions.create` or `cloudfunctions.functions.update` permission, the deployment will fail, and the intermittent nature may be due to eventual consistency or race conditions in IAM propagation.

What should I do if I get this PCD question wrong?

Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.

Are there clue words in this question I should notice?

Yes — watch for: "most likely". Probability qualifier — the question wants the most probable cause or outcome, not a guaranteed one. Eliminate low-probability options.

What is the key concept behind this question?

Read the scenario before looking for a memorised answer.

About these practice questions

Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

Keep practising

More PCD practice questions

Last reviewed: Jul 4, 2026

Question Discussion

Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.

Loading comments…

Sign in to join the discussion.

This PCD practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PCD exam.