Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to deploy a Google Apps Script as a web app that won't change URL on each deploy?

I have written an Apps Script for personal use that I want to invoke with an HTTP request. (I'm basically using this like a "serverless function" with native authentication to Google Apps APIs.)

I can do this easily by deploying my Apps Script project as a Web App, which gets me a URL like

https://script.google.com/macros/s/${DEPLOYMENT_ID}/exec

However, if I make changes to my script and want to push those changes live, I have to create a new deployment, which will have a new deployment ID, thus changing the URL.

I know that I could use a "Test Deployment" to get a URL that always points to the project HEAD, but this always requires authentication from the HTTP client. With my deployment, I can set "Who has access" to "Anyone" and avoid this requirement.

Is it possible to deploy a web app script to a URL that will not change on future deployments?

like image 710
NReilingh Avatar asked Jan 23 '21 07:01

NReilingh


People also ask

How do I deploy a Google Apps Script as a web app?

At the top right of the script project, click Deploy > Test deployments. Next to "Select type," click Enable deployment types settings > Web app. Under the web app URL, click Copy. Paste the URL in your browser and test your web app.

What does deploying a Google script do?

An Apps Script project deployment is a version of the script that is made available for use as a web app, add-on, or API executable. By creating and managing deployments, you can iterate on your code, keep track of your changes, and control the exact code version your users have access to.

How long can a Google Apps Script run?

A single execution of Apps script can last no longer than 6 minutes and you're hitting this limit.


1 Answers

In the old editor deploying to the same URL is the default behavior because you can only have one deployment. The new editor allows you to have multiple deployments, each with its own URL and (possibly) pointing to different versions of your application.

To update an existing deployment to a different version, or to create a new version, you need to edit your deployment's configuration. Editing deployment configuration

like image 83
Luis Escobar Avatar answered Nov 09 '22 03:11

Luis Escobar