Downloading Your Application

To download an application's files, run the command with the download_app action. -A [YOUR_PROJECT_ID] -V [YOUR_VERSION_ID] download_app [OUTPUT_DIR]


  • [YOUR_PROJECT_ID] is your Cloud project ID.
  • [YOUR_VERSION_ID] is the version ID of your application that you want to download.
  • [OUTPUT_DIR] is the full directory path to where you want your files downloaded.

For more information about this command, see the download_app reference.

If the command is successful, you get output similar to the following:

Getting file list...
Fetching files...
Getting files...

[1/5] request.class
[2/5] login.class
[3/5] static/screen.css
[4/5] static/print.css
[5/5] images/bird.png


Command not found

If you installed the Google Cloud SDK and use the gcloud tool, the command is available from the [SDK_INSTALL_PATH]/google-cloud-sdk/platform/google_appengine/ directory.

For example, to use the Google Cloud SDK, you run the by specifying the directory path:

[SDK_INSTALL_PATH]/google-cloud-sdk/platform/google_appengine/ -A [YOUR_PROJECT_ID] -V [YOUR_VERSION_ID] download_app [OUTPUT_DIR]
You do not have permission to download this app version

Only the authenticated user who deployed the version of the application as well as the users with the project Owner role have the privileges to download files. Other users who attempt to download the application will receive an error message similar to the following:

Fetching file list...
Error 403: --- begin server output ---
You do not have permission to download this app version.
--- end server output ---

Preventing Source Code Downloads

Download access to any available source code can be restricted by using an Organization Policy.

The constraint for controlling code downloads is:


The default value for the constraint is false, meaning that code downloads are enabled. You can enable this policy constraint on an organization, project and folder and are inherited by child resources. For example, a project inherits policy constraints set on its containing folder, and a folder inherits constraints set on an organization.


You can set the appengine.disableCodeDownload constraint if you have been granted the orgpolicy.policyAdmin role on the organization.

Setting the policy constraint on the organization level

You need your project's organization ID to set the constraints/appengine.disableCodeDownload constraint.

Find your organization ID


You can find the ID on the Google Cloud Console:

  1. Log in to the Google Cloud Console.
  2. Click on the project selector.

    Screenshot of organization and project selector

  3. Select an organization and look for the organization ID.

    Screenshot of organization ID


Run the following gcloud command and look for the ID:

gcloud organizations list

Example gcloud output something like the following, where ID is the project ID:

example-organization   29252605212

Setting your policy constraint


To set the organization policy, configure the constraint to disable source code download:

  1. Go to the Organization policies page in the Google Cloud Console.

    Go to the Organization policies page

  2. Click the Organization drop-down list at the top of the page and then select your organization.
  3. Click Disable Source Code Download.
  4. Click the Edit button.
  5. Under Applies to, select Customize.
  6. Under Enforcement, select On.
  7. Click Save. A notification will appear to confirm that the policy has been updated.


Policies can be set using the gcloud command-line tool.

To disable source code download, run the following command:

gcloud alpha resource-manager org-policies enable-enforce \
    --organization 'ORGANIZATION_ID' \

To disable the policy, the same command can be issued with the


You can set the appengine.disableCodeDownload constraint at the folder and project level. To learn more about using constraints in organization policies, see Using Constraints.