Testing and Deploying Your Application

Running locally

You run your application locally with the native development tools that you usually use.

Deploying your application

Deploy your app to App Engine using the gcloud app deploy command. This command automatically builds a container image by using the Container Builder service and then deploys that image to the App Engine flexible environment. The container will include any local modifications that you've made to the runtime image.

To programmatically deploy your apps, use the Admin API.

Before you begin

Before you can deploy your app:

Deploying a service

You deploy your app to App Engine by deploying versions of your app's services and each of their configuration files.

To deploy a version of your app's service, run the following command:

gcloud app deploy .\bin\Debug\netcoreapp1.0\publish\app.yaml

By default the deploy command automatically generates a new version ID each time that you use it and will route any traffic to the new version.

To override this behavior, you can specify the version ID with the version flag:

gcloud app deploy .\bin\Debug\netcoreapp1.0\publish\app.yaml --version myID

You can also specify not to send all traffic to the new version immediately with the --no-promote flag:

gcloud app deploy .\bin\Debug\netcoreapp1.0\publish\app.yaml --no-promote

Manually building a container for deployment

To build your container images outside of Google Cloud Platform, you must first upload your images to a container image repository before you can deploy your images to App Engine with the gcloud app deploy command.

For example, if you build your container images locally with Docker, you can push those images to Google Container Registry and then specify the URL of your image in the --image-url flag of the command:

gcloud app deploy .\bin\Debug\netcoreapp1.0\publish\app.yaml --image-url gcr.io/[MY_PROJECT_ID]/[MY_CONTAINER_IMAGE]

Using automated continuous deployment pipelines

You can use Container Builder to automate deployments in continuous deployment pipelines. For more information, see Deploying artifacts, and Automating Builds using Build Triggers in the Container Builder documentation.

Docker base images for .NET

If you'd like to build a .NET custom runtime application from scratch, you can use this base image in a Dockerfile:

Runtime Docker command
.NET FROM gcr.io/google-appengine/aspnetcore:1.0.7
.NET FROM gcr.io/google-appengine/aspnetcore:1.1.4
.NET FROM gcr.io/google-appengine/aspnetcore:2.0.0

Viewing your application

After you deploy your app to App Engine, you can run the following command to launch your browser and view the app at http://[YOUR_PROJECT_ID].appspot.com:

gcloud app browse


The following is a common error message that you might encounter when deploying apps:

PERMISSION_DENIED: Operation not allowed
The "appengine.applications.create" permission is required.
If the GCP project does not include the required App Engine application, the gcloud app deploy command can fail when it tries to run the gcloud app create command. Only accounts with Owner role have the necessary permissions to create App Engine applications.

Send feedback about...

App Engine flexible environment for .NET docs