A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://cloud.google.com/appengine/docs/legacy/standard/python/user-managed-service-accounts below:

Using user-managed service accounts | App Engine standard environment for Python 2

Using user-managed service accounts

Stay organized with collections Save and categorize content based on your preferences.

App Engine apps require a service account in order to access other Google Cloud services and execute tasks. By default, the App Engine default service account is used as the identity of your App Engine app. You may also specify a different user-managed service account to be used as the identity for a specific version of your App Engine app. This allows you to grant different privileges to each version, based on the specific tasks it performs, and avoid granting more privileges than necessary.

This guide covers how to specify a different user-managed service account when deploying a new version. If you don't need to create a distinct service account when deploying a specific version of your app, you can continue to use the default service account by not specifying a service account.

Creating a user-managed service account

To create a user-managed service account, see these instructions. When defining the Identity and Access Management (IAM) roles to grant your service account, you can refer to Roles that Grant Access to App Engine.

If you need to review IAM concepts before creating your service account, see IAM concepts overview and service accounts guides.

Warning: Do not remove the existing App Engine standard environment service agent in your project. The service agent delegates the user-managed service account as the identity for your app. If you remove the service agent, you will see IAM permission errors.

After you create your user-managed service account, you can update the app-level default service account for your application by using one of the following methods:

Important: Only versions deployed after the update will use the new app-level default service account. All previously deployed versions will not use the new app-level default service account until you re-deploy that version. gcloud

Run the gcloud app update command.

    gcloud app update --service-account=SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com

Replace:

Each new version that you deploy after this update uses the new app-level default service account unless you explicitly assign a version-specific service account.

Console
  1. Go to the App Engine Application Settings tab in the console and click Edit Application Settings.

    Go to Application Settings

  2. Choose an app-level default service account from Select a Service account and click Save.

    You will be redirected to the Application Settings tab where you can view the email address of your updated app-level default service account. Example: SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com.

    Each new version that you deploy after this update uses the new app-level default service account unless you explicitly assign a version-specific service account.

Specifying a service account when deploying your app Note: If a user-managed service account is specified in both the app.yaml file and in the gcloud CLI, the gcloud setting is used. gcloud

Run the gcloud app deploy command and specify your service account:

gcloud app deploy --service-account=SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com
app.yaml

In your app.yaml file, specify your service account by adding the service_account element:

service_account: SERVICE_ACCOUNT_NAME@PROJECT_ID.iam.gserviceaccount.com
Next steps

Follow best practices for working with service accounts.

Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Last updated 2025-08-07 UTC.

[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["App Engine apps utilize a service account to access other Google Cloud services, with the option to use the default or a user-managed service account."],["Specifying a user-managed service account allows you to assign unique privileges to different versions of your App Engine app, based on their roles, which reduces unnecessary permissions."],["User-managed service accounts can be created using the provided instructions and assigned specific IAM roles, and do not delete the existing App Engine service agent to avoid errors."],["When deploying your app, you can specify a user-managed service account using the `gcloud app deploy` command or by modifying the `app.yaml` file with the `service_account` element, with command-line specification overriding any setting in the file."]]],[]]


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4