To download an application's files, run the
appcfg.sh command with the
appcfg.sh -A [YOUR_PROJECT_ID] -V [YOUR_VERSION_ID] download_app [OUTPUT_DIR]
[YOUR_PROJECT_ID]is your GCP 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
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
appcfg.shcommand is available from the
For example, to use the Google Cloud SDK, you run the
appcfg.shby specifying the directory path:
[SDK_INSTALL_PATH]/google-cloud-sdk/platform/google_appengine/appcfg.sh -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
Find your organization ID
You can find the ID on the Google Cloud Platform Console:
- Log in to the Google Cloud Platform Console.
Click on the project selector.
Select an organization and look for the organization ID.
Run the following
gcloud command and look for the ID:
gcloud organizations list
gcloud output something like the following, where ID is the
DISPLAY_NAME ID example-organization 29252605212
Setting your policy constraint
To set the organization policy, configure the constraint to disable source code download:
- Go to the Organization policies page in the Google Cloud Platform Console.
- Click the Organization drop-down list at the top of the page and then select your organization.
- Click Disable Source Code Download.
- Click the Edit button.
- Under Applies to, select Customize.
- Under Enforcement, select On.
- 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' \ appengine.disableCodeDownload
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.