All Products
Search
Document Center

Function Compute:Use Application Center to continuously deploy an existing Function Compute project

Last Updated:Jan 02, 2026

Manually updating and releasing services and functions in Function Compute can be tedious and error-prone. To improve this process and reduce risks, you can use Application Center to deploy your existing Function Compute project, which enables continuous deployment. Application Center provides customizable pipelines that automate builds and releases. You can also add manual approvals to manage the build and deployment of projects in the cloud.

Prerequisites

  • You have deployed a service and a function. For more information, see Create a function.

    This topic uses a Node.js application as an example to demonstrate the deployment steps in Application Center.

  • Your function code is managed by Git.

    Application Center works with common Git services, such as GitHub, Gitee, Codeup, and self-hosted GitLab. The example in this topic uses GitHub to manage the function code.

Step 1: Prepare build commands and confirm the build tool version

Prepare build commands

Application Center provides the execution environment needed to build functions, but it does not automatically handle the build and packaging process. You run the same build and packaging commands in the cloud as you do locally. Note that build methods differ between a Windows environment and the Linux environment in the cloud. To learn how to correctly develop and build functions, refer to the deployment packages provided for different runtimes. For more information, see Code development overview.

This topic uses Node.js as an example. The following are sample build commands to run locally. Prepare the build commands that are specific to your function's code. You will use these commands later to configure the pipeline in Application Center.

# Use the npm tool to build. This is usually the install command. You can also add custom functions.
# Any command that meets the build requirements is acceptable.
npm install ./code -production --registry=https://registry.npmmirror.com
# Use the zip command for packaging. The s tool also supports automatic zipping.
# To avoid packaging unintended content, we recommend the zip command.
# This command packages the code. The compressed package is placed in the root directory, but you can place it elsewhere.
zip code.zip -r ./code/*

Confirm the build tool version

Application Center integrates multiple build tool versions in the build environment. You can switch between them as needed. This topic uses Node.js version 16. You will use this version when you configure the pipeline in Application Center.

Step 2: Prepare the s.yaml file

Use an s.yaml configuration file to define all your services and functions. Place the s.yaml file in your code repository and use the Serverless Devs tool for deployment.

For functions that are already deployed in Function Compute, prepare the s.yaml file as follows:

  1. Log on to the Function Compute console. In the left-side navigation pane, click Services & Functions.

  2. In the top navigation bar, select a region. On the Services page, click the desired service.

  3. On the Functions page, click the target function.

  4. On the Function Details page, choose Export Function > Export Configuration. In the Export Configuration dialog box, click OK to download the s.yaml file to your local machine.

  5. Modify the s.yaml file. Place the modified file in the root directory, and then commit it to the Git repository for your function code.

    The downloaded s.yaml file is similar to the following example. Make the following changes:

    1. Remove the access: '{{ access }}' line.

    2. Change codeUri to the actual path of the build artifact, such as ./code.zip. For more information about the build artifact path, see Prepare build commands.

    image.png

To describe multiple services and functions, export the corresponding s.yaml files for each and then combine them. For more information about the s.yaml specification and how to declare multiple functions, see YAML specifications and permission management.

Step 3: Create an application in Application Center

  1. In the left navigation pane, click Applications. On the Applications page, click Create Application.

  2. On the Create Application page, select Import Application from Repository. Set Repository Type to GitHub and configure the information for the target repository.

    If your account does not have the required permissions for Application Center, follow the on-screen prompts to log on to the GitHub console and grant the permissions.

  3. In the Environment Configuration section, the settings for this example are as follows:

    • Pipeline Configuration Method: Custom Configuration.

    • Application Deployment Trigger: Trigger on Push to a Specific Branch.

    • Pipeline Execution Environment: Default Execution Environment.

  4. After you complete the configuration, click Create and Deploy Default Environment to create the application.

Step 4: Configure the pipeline in Application Center

The first deployment of the created application might fail. You need to modify the build and deployment tasks in the pipeline so that Application Center can build the application correctly. For more information about pipeline concepts and usage, see Concepts and Manage pipelines.

On the Environment Details page of the application, select the Pipeline Management tab. In the Pipeline Details section, modify the YAML file, and then click Save. The changes for this example are as follows:

  • Use a pipeline plugin to initialize the Serverless Devs tool and pull the code.

  • Use the runtime-setup plugin to specify the build tool version. For more information about how to determine the build tool version, see Confirm the build tool version.

  • Use the OSS cache plugin and configure a cache path to speed up the NPM build.

  • Use the prepared build commands to build the code.zip package. For more information about how to obtain the build commands, see Prepare build commands.

  • Use the build plugin to deploy the resources.

image.png

Step 5: Verify continuous deployment with a Git push

Push the modified code to the master branch of the code repository. This triggers the pipeline and automatically deploys the code to Function Compute.

  • You can view the execution details in the Pipeline Execution History section on the Pipeline Management tab.

    image.png

  • You can click the function resource deployed by Application Center to view the code updates.

    Note

    You cannot view code updates for code that does not support online editing.

    On the Environment Details tab, in the Resource Information section, click the function to open its details page. Click Function Code to verify that the code pushed through Git has been updated.

References