Function Compute provides the versioning feature to help you manage services, functions, and triggers in an efficient manner. You can use this feature to publish multiple versions of a service to implement continuous integration (CI) and continuous delivery (CD) in software development lifecycles. This topic describes how to manage versions in the Function Compute console.

What is a version?

Function Compute provides the service-level versioning feature, which allows you to publish one or more versions for a service. A version is similar to a service snapshot that contains the information such as the service settings, and the code and settings of functions that belong to the service. A version does not contain trigger information. When you publish a version, the system generates a snapshot for the service and assigns a version number that is associated with the snapshot for future use.

If you do not use the versioning feature, every change in a service affects the production environment. This way, you cannot control the time to publish the latest versions. If you use the versioning feature, you can use a stable version to respond to online requests after the test results become stable. In addition, you can continue to develop and test the LATEST version. The following figure shows the mechanism for the versioning feature.



  • A new service has only one LATEST version. Before you publish any version of the service, the LATEST version is the only version that you own. The LATEST version cannot be deleted.
  • A published version cannot be modified. The version number monotonically increases and cannot be reused.


Publish a version

  1. Log on to the Function Compute console. In the left-side navigation pane, click Services & Functions.
  2. In the top navigation bar, select the region where the service resides.
  3. On the Services page, click the desired service. In the left-side navigation pane, click Versions.
  4. On the Versions page, click Publish Version. In the Publish New Version of Service panel, enter the description of the version that you want to publish, and then click OK.
    After the version is published, you can view the published version on the Versions page. You can also delete the versions that you no longer need and set the specified version as the primary or canary version of the alias as prompted.
Note When you delete a version, only the functions and configurations of the version are deleted. However, the aliases or triggers that point to the version are retained. Therefore, we recommend that you remove the aliases and triggers that point to this version before you delete the version. Otherwise, an error occurs when you call the alias that points to the version.

Additional information

Aside from the Function Compute console, you can also use Serverless Devs to configure versions for a service. For more information, see Serverless Devs commands.