M. D.
M. D.

Reputation: 57

Using Google Colab to create App on GCP APP ENGINE

I can't install anything on my computer, so I can't install Google Cloud SDK

So I want to play on GCP using a Google Colab

But I fail with the command !gcloud app create

Here is my code and outputs:

%pip install google-cloud-language>=2.9.1
PROJECT_ID = "myprojectXXX"  

from google.colab import auth
auth.authenticate_user(project_id=PROJECT_ID)

✔️ Authenticated

!gcloud services enable cloudbuild.googleapis.com
!gcloud services enable appengine.googleapis.com
!gcloud auth list

Credentialed Accounts ACTIVE ACCOUNT

!gcloud projects get-iam-policy $PROJECT_ID

bindings: ....

!gcloud app create

API [appengine.googleapis.com] not enabled on project [522309567947]. Would you like to enable and retry (this will take a few minutes)? (y/N)? y Enabling service [appengine.googleapis.com] on project [522309567947]... ERROR: (gcloud.app.create) PERMISSION_DENIED: Permission denied to enable service [appengine.googleapis.com] Help Token: ARD_zUb9RQJs5iFgLt81VNfA3FdVaWDebsJQ0vgp6l-iBSS4jhaDyMlBcEpw-T7-0g_mEZ-s1DPTlUGBK5eGLqADr6bkccfqF3t6Yo0TjF37

Can anyone tip to me understand why permission is denied as I authenticated using my gmail account which has owner role ?

Upvotes: 0

Views: 476

Answers (1)

Kapil Sakhare
Kapil Sakhare

Reputation: 314

The error message indicates that you do not have sufficient permissions to enable the App Engine service on your project. Even though you have an owner role, you may need to grant specific permissions to enable App Engine. You may require App engine admin and App Engine Service Admin roles,apart from these roles check below roles which might help you to resolve the issue:

Once you have granted the above roles, try running the command “gcloud app create” again. Which may help to resolve the error.

Also refer to the GCP official Troubleshoot App Engine errors for more information.

EDIT1:

If you are deploying new versions of an app, you may need to grant Service Account User role (roles/iam.serviceAccountUser). Refer to official GCP doc for more details. After following above suggestions if you are still getting issues,please follow below additional steps

1.Make sure that you are using the correct project ID when enabling the App Engine service.

2.Sometimes, restarting the gcloud command can resolve permission issues.

EDIT 2:

To achieve seamless integration between GCP services and Jupyter Notebook, you need to configure the necessary APIs, permissions, and credentials.

  • Try enabling the App Engine Admin API, if you are not yet enabled. Go to the Google Cloud Console >> Click on [APIs & Services] >> Search for and enable the "App Engine Admin API".

Note : Grant the App Engine Admin role to your user account: A service account acts as an identity for your notebooks and allows them to access GCP resources securely. Properly add your user account to the app engine admin role. Refer :

Upvotes: 1

Related Questions