All Products
Search
Document Center

Serverless App Engine:Deploy your first serverless application

Last Updated:Jun 02, 2026

Upload code or an image to Serverless App Engine (SAE) to deploy applications. SAE manages compute resources and supports traffic-based auto scaling and multi-zone deployment.

Solution overview

You will deploy microservice applications that register with each other, call methods across services, and serve traffic from the internet. The sample architecture:

image
This tutorial uses a Java microservice as an example, but SAE supports any language or architecture: static websites, front-end and back-end applications, monolithic applications, and microservice applications.

In this tutorial, you will:

  1. Deploy applications: Deploy provider and consumer applications with sample images. SAE's built-in Nacos handles service registration and discovery, enabling the consumer to call the provider.

  2. Access the application from the internet: Configure a public endpoint for the consumer application.

Prerequisites

Activate SAE and grant permissions

Use your Alibaba Cloud account to activate SAE, then use RAM users to manage SAE resources.

Activate SAE for your Alibaba Cloud account

Go to the SAE product page, and click Get Started. Log in and follow the instructions to activate SAE and create a service-linked role.

Important

After activating SAE, you are charged on a pay-as-you-go basis for resources that exceed the quota and period of the free trial. To save costs, you can purchase a subscription package.

Grant permissions to a RAM user

Use an Alibaba Cloud account to grant permissions to a RAM user and attach the permission policies required by SAE to manage SAE resources.

Procedure

SAE supports multiple deployment methods. Choose console or saectl (kubectl-compatible) to complete this tutorial.

Console

1. Deploy applications

  1. Deploy the provider application: Log in to the SAE console. Choose . Select a region (this tutorial uses China (Hangzhou)). Click Create Application, configure the following parameters, and click Create Application Now to skip Advanced Settings.

    If is not in the navigation pane, choose .
    If prompted to select an edition, select Standard Edition. The Lightweight Edition and Professional Edition are in invite-only beta. Edition differences do not affect this tutorial.
    1. Enter a custom Application Name, such as provider.

    2. Set Namespace Type to System-created. This uses the default namespace and automatically provisions network resources (VPC, vSwitch, and security group).

    3. Set Deployment Method to Deploy Using Image. Click Set Image. On the Demo Image tab, select Microservice Application - Provider with Image Version microservice-java-provider-v1.0, then click OK.

    4. In Capacity Settings, set the Instance Specification and Number of Instances for your application.

  2. Deploy the consumer application: Repeat the preceding steps with the following changes.

    1. Enter a custom Application Name, such as consumer.

    2. When you Set Image, find Microservice Application - Consumer and set Image Version to microservice-java-consumer-v1.0.

  3. Check the deployment result: Wait about one minute for deployment to complete.

    1. View the applications on the Application List page. Click an application to open its details.

    2. Choose Basic Information in the navigation pane. On the Instance List tab, view the application instances.

2. Enable public access

Bind an internet-facing CLB instance to the consumer application for public access.

  1. Bind an internet-facing CLB instance to the consumer application: On the consumer application details page, go to the Application Information tab. In Application Access Settings, select CLB-based Access. Click Add internet-facing CLB, configure the following parameters, and click OK.

    1. For CLB Instance, select Create CLB Instance.

    2. On the HTTP Protocol tab, set HTTP Port to 80 and container port to 18082.

  2. Verify the result: After SAE creates and binds the CLB instance, the console displays the application's public endpoint.

    1. Open http://<public_endpoint>/consumer-echo/hello in your browser, replacing <public_endpoint> with the actual value.

    2. On the page, view the call topology between the consumer and provider applications.

3. Clean up resources

Clean up resources after completing this tutorial to avoid unnecessary charges.

  1. Delete the applications: On each application's details page, choose and follow the instructions.

    The CLB instance that SAE created is automatically released when you delete the application.
  2. (Optional) Delete network resources: SAE automatically created a VPC, vSwitch, and security group during deployment.

    1. View the VPC: Choose and click default. On Basic Information, click the VPC link to open its details page.

    2. View the vSwitch and security group: On the VPC's Resource Management tab, click the links to their details pages.

    3. Delete the resources on their respective details pages.

saectl tool

1. Install and configure saectl

2. Deploy the applications

  1. Create resource configuration files: Create the following files in the same directory. Note: Replace image: ...cn-hangzhou... with your deployment region.

    1. deployment-provider.yaml configures the provider application:

      apiVersion: apps/v1
      kind: Deployment
      metadata:
        annotations:
          sae.aliyun.com/new-sae-version: std # Select the application edition. 'std' indicates Standard Edition. The Lightweight and Professional editions are in invite-only beta. This selection does not affect the tutorial.
        name: provider # Customizable application name.
        namespace: default # Select the system-created default namespace, which automatically creates and associates network resources like VPCs, vSwitches, and security groups.
      spec:
        replicas: 2 # Number of application instances.
        selector:
          matchLabels:
            sae.aliyun.com/app-name: provider # Must be the same as the application name defined in metadata.
        template:
          metadata:
            labels:
              sae.aliyun.com/app-name: provider # Must be the same as the application name defined in metadata.
          spec:
            containers:
            - name: main # We recommend that you name the container 'main' to avoid conflicts.
              image: registry.cn-hangzhou.aliyuncs.com/sae-serverless-demo/sae-demo:microservice-java-provider-v1.0 # The sample image for the provider application. Replace cn-hangzhou with your deployment region.
              resources: # Specification for a single application instance. 'limits' and 'requests' must have the same configuration.
                limits:
                  cpu: "2"
                  memory: 4Gi
                requests:
                  cpu: "2"
                  memory: 4Gi
      
    2. deployment-consumer.yaml configures the consumer application:

      apiVersion: apps/v1
      kind: Deployment
      metadata:
        annotations:
          sae.aliyun.com/new-sae-version: std # Select the application edition. 'std' indicates Standard Edition. The Lightweight and Professional editions are in invite-only beta. This selection does not affect the tutorial.
        name: consumer # Customizable application name.
        namespace: default # Select the system-created default namespace, which automatically creates and associates network resources like VPCs, vSwitches, and security groups.
      spec:
        replicas: 2 # Number of application instances.
        selector:
          matchLabels:
            sae.aliyun.com/app-name: consumer # Must be the same as the application name defined in metadata.
        template:
          metadata:
            labels:
              sae.aliyun.com/app-name: consumer # Must be the same as the application name defined in metadata.
          spec:
            containers:
            - name: main # We recommend that you name the container 'main' to avoid conflicts.
              image: registry.cn-hangzhou.aliyuncs.com/sae-serverless-demo/sae-demo:microservice-java-consumer-v1.0 # The sample image for the consumer application. Replace cn-hangzhou with your deployment region.
              resources: # Specification for a single application instance. 'limits' and 'requests' must have the same configuration.
                limits:
                  cpu: "2"
                  memory: 4Gi
                requests:
                  cpu: "2"
                  memory: 4Gi
      
  2. Deploy the applications: Run saectl apply -f deployment-provider.yaml -f deployment-consumer.yaml from the directory containing the configuration files.

  3. Verify the result:

    1. View the applications: Run saectl get deployments -n default. The -n default flag specifies the default namespace. In the output:

      1. STATE RUNNING means the application is running. PUBLISHING means deployment is in progress.

      2. The READY field shows n/m, which represents number of ready instances / desired number of instances.

    2. View the application instances: Run saectl get pods -n default. In the output:

      1. STATUS RUNNING means the container is running normally. ContainerCreating means the container is being created.

      2. The READY field shows n/m, which represents number of ready containers / total number of containers.

3. Enable public access

Bind an internet-facing CLB instance to the consumer application for public access.

  1. Create a resource configuration file: Create a svc.yaml file to configure a Service that exposes the consumer application to the internet through an internet-facing CLB:

    apiVersion: v1
    kind: Service
    metadata:
      annotations:
        sae.aliyun.com/loadbalancer-address-type: internet # Address type. 'internet' for public and 'intranet' for private.
      name: internet-consumer # Fixed format: ${address-type}-${app-name}
    spec:
      ports:
      - name: port-80 # Fixed format: port-${external-port}
        port: 80
        protocol: HTTP
        targetPort: 18082 # Container port of the consumer application.
      selector:
        sae.aliyun.com/app-name: consumer # Application name.
      type: LoadBalancer
    
  2. Deploy the service: Run saectl apply -f svc.yaml from the directory containing the configuration file.

  3. Verify the result:

    1. View the service: Run saectl get services -n default. In the output:

      1. EXTERNAL-IP shows the public IP address. <pending> means the service is still being created.

      2. PORT(S) shows the configured access port.

    2. Access the application from the internet: Run curl http://<public_endpoint>:<access_port>/consumer-echo/hello, replacing <public_endpoint> and <access_port> with actual values. The output confirms the consumer calling the provider.

4. Clean up resources

Clean up resources after completing this tutorial to avoid unnecessary charges.

Delete the applications: Run saectl delete -f deployment-provider.yaml -f deployment-consumer.yaml.

The CLB instance that SAE created is automatically released when you delete the application.

Next steps