Every Apps Script project uses Google Cloud to manage authorization, advanced services, and other details. To configure and manage these settings, every Apps Script project has an associated Google Cloud project. Your script project can use a default project that Apps Script automatically creates, or a standard project that you create yourself. In general, default projects are good for everyday or simple scripts, but you should use a standard project for any application that is complex, commercial quality, or that you intend to publish.
You can switch from a default project to a standard project at any time, but you can't switch back to use a default project. It's best to select the Cloud project your script uses early in development. Switching later can cause complications, like requiring your users to re-authorize.
Default Cloud projectsWhen you create an Apps Script project, Apps Script creates a default Cloud project that operates in the background.
By default, Cloud projects have an Identity and Access Management (IAM) policy with one entry, a Google service account that acts as the owner of the default project. The Google service account is appsdev-apps-dev-script-auth@system.gserviceaccount.com
.
Most users can’t directly locate, view, or edit default projects in the Google Cloud console. If you're an Admin, refer to View default Google Cloud projects.
If you created your script project before April 8, 2019, you might use a default project that you can access in the Google Cloud console. To access the default project, go to the script project's settings and click the project number.
Delete default Cloud projectsIf you're an administrator, you can delete default Cloud projects like you would standard Cloud projects. See View or edit default Cloud projects.
If you're not an administrator, you can't manually delete default projects. However, if you delete the script project or switch it to use a standard project, Apps Script deletes the default project attached to the script along with any settings or information it contains.
Standard Cloud projectsDefault Cloud projects are the best option for most script projects, unless you need to manually configure the project. In these situations, you must switch your script project to use a standard project.
The following sections describe when Apps Script requires a standard project, the properties of such projects, and common tasks done with them. You can only perform the below tasks with standard projects.
When Apps Script requires standard Cloud projectsYou must use a standard project in the following situations:
scripts.run
method.Standard projects have the following properties:
scripts.run
method, the script project and the calling application must share the same standard project.To access the standard project associated with your script project, do the following:
You can also find a standard project directly on the Google Cloud console Manage Resources page.
Activate an API in a standard Cloud projectOften an Apps Script application needs access to another Google API. To do this, you must activate the API in the corresponding Cloud project. Activate an API by doing the following:
You might be prompted to accept the Terms of Service for Google APIs or Google Cloud. Review the Terms of Service carefully before accepting them.
Depending on the application, you might also need to configure the API by selecting it in the APIs & Services dashboard.
Determine the ID & number of a standard Cloud projectAll Cloud projects have a project name, project ID, and project number. Occasionally, you must have these identifiers to configure services or complete other tasks.
To determine your standard project's ID and number, do the following:
If you're using Google Cloud logging or error reporting for your script project, you can view those logs and reports in the Google Cloud console by doing the following:
When using services that require OAuth, Google prompts users to authorize those services. The OAuth consent screen settings let you set some of the information that Google presents to users, such as the application name and Terms of Service URL.
Default Cloud projects create a consent screen automatically from the Apps Script project details; you can't adjust those settings. Standard Cloud projects let you customize this information. You can configure your script's consent screen by doing the following:
Apps Script usually sets up OAuth for the services your script uses. For some applications, you must create additional OAuth credentials (client IDs and client secrets). You can only do this with standard projects.
To create a client ID and client secret for your script project, do the following:
You can add additional owners or other roles to a standard project. If you're collaborating on a project, this helps ensure that someone on your team always has access to the script project's Google Cloud settings.
You can add additional owners or other roles to a standard project by doing the following. You must have edit permissions for the project to make any of these changes:
You can have multiple Apps Script projects share the same standard Cloud project. To do this, create a standard project and then switch each script project to use it. You can't do this with default projects.
Note: If you want to publish your script project on the Google Workspace Marketplace as an add-on, it must have its own standard project—published apps can't share Cloud projects. Use a different standard Cloud projectYou can switch a script project so that it uses a different standard Cloud project. If your script requires manual configuration of the Cloud project, you must switch from a default project to a standard project. To learn more about when you need to use a standard project, refer to standard Cloud projects.
Effects of switching to a different standard Cloud projectIf you switch your script from a default project or to a different standard project, it has the following effects:
In your standard Cloud project, turn on the Drive API:
To switch a script's existing Cloud project over to another Cloud project, follow these steps:
Shared drives (formerly Team Drives) provide shared spaces where groups of Drive users can collaborate on Apps Script projects and Drive documents. Shared drives are valuable when developing scripts, add-ons, and web apps with a team, but they place some restrictions on what you can do with older default Cloud projects.
The following list of restrictions describes how Cloud projects interact with shared drives:
To avoid the above restrictions for older scripts, switch to a standard project.
Get a list of Apps Script Cloud projectsIf you have the resourcemanager.projects.list
permission for your organization's Apps Script project folder, you can view all of the standard and default Apps Script Cloud projects within the folder.
To delete an Apps Script Cloud project, follow the steps under Get a list of Apps Script Cloud projects, select the project you want to delete and click Delete.
Note: You must be an admin to delete default projects.To delete an Apps Script project using gcloud
, use the following commands.
gcloud projects list --filter='parent.id=APPS_SCRIPT_FOLDER_ID'
gcloud projects delete PROJECT_ID
For more information about deleting Cloud projects, see Shutting down (deleting) projects.
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