This topic defines the service in Function Compute and describes how to create and update a service in the Function Compute console.

What is a service?

A service is a unit for resource management in Function Compute. Before you can create a function, you must create a service. Functions that belong to a service inherit the attributes of the service, such as the permissions and log settings of the service.

From a business perspective, an application is made up of multiple services. From a resource usage perspective, a service is made up of multiple functions. For example, a data processing service consists of two functions: a data preparation function that requires less resources and a data processing function that requires more resources. You can configure an instance that has low specifications to run the data preparation function, and configure an instance that has high specifications to run the data processing function.

Create a service

  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 Create Service.
  3. In the Create Service panel, enter a service name and description, configure the following parameters, and then click OK.
    ParameterDescriptionExample
    LoggingSpecify whether to enable the logging feature. Take note of the following items:
    • Enable: Function Compute sends function execution logs to Log Service for persistent storage. You can debug code, troubleshoot issues, and analyze data based on the logs.
    • Disable: You cannot use Log Service to store or query function execution logs.
    Enable
    Advanced settings
    Tracing AnalysisSpecify whether to enable Tracing Analysis. Take note of the following items:
    • Enable: enables Tracing Analysis. You can use Jaeger to upload trace information. This allows you to view the traces of functions. You can also analyze and diagnose performance bottlenecks in serverless architectures. For more information, see Overview.
    • Disable: disables Tracing Analysis.
    Enable
    Server RoleConfigure the role for functions in the service so that functions can obtain the permissions of the role. For more information, see Grant Function Compute permissions to access other Alibaba Cloud services. AliyunFCDefaultRole
    Access to VPCSpecify whether to allow functions to access virtual private cloud (VPC) resources. For more information, see Configure network settings. Yes
    VPCThis parameter is required if you set Access to VPC to Yes. Create a VPC or select the ID of an existing VPC that you want to access from the drop-down list. fc.auto.create.vpc.1632317****
    vSwitchThis parameter is required if you set Access to VPC to Yes. Create a vSwitch or select the ID of an existing vSwitch from the drop-down list. fc.auto.create.vswitch.vpc-bp1p8248****
    Security GroupThis parameter is required if you set Access to VPC to Yes. Create a security group or select an existing security group from the drop-down list. fc.auto.create.SecurityGroup.vsw-bp15ftbbbbd****
    Access to InternetSpecify whether to allow functions in the service to access the Internet. If you set this parameter to No, functions in the service cannot access the Internet by using the default network interface controller (NIC) in Function Compute.
    Important If you want to use a static public IP address to access the Internet, you must set Access to Internet to No. Otherwise, the configured static public IP address does not take effect. For more information, see Configure static public IP addresses.
    Yes
    After the service is created, you can click Services & Functions to view the created service on the Services page.

Update a service

  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, find the desired service and click Configure in the Actions column.
  3. On the Modify Service page, configure the parameters based on your business requirements and click Save.
    • Optional:Basic Settings

      Configure basic information for the service. You can modify only the service description.

      ParameterDescriptionReference
      DescriptionEnter a description for the service. The description helps you identify the purpose of the service. None
    • Optional:Other configurations
      ParameterDescriptionReference
      Role SettingsConfigure the role for the functions in the service so that the functions can obtain the permissions of the role. Grant Function Compute permissions to access other Alibaba Cloud services
      Logging SettingsConfigure the logging feature for the service. After the logging feature is enabled, you can view the function execution logs. This allows you to perform code debugging, fault analysis, and data analysis.
      Tracing Analysis SettingsEnable: After you enable Tracing Analysis, you can use Jaeger to upload trace information. This allows you to view the traces of functions. You can also analyze and diagnose performance bottlenecks in a serverless architecture. Enable Tracing Analysis
      Network SettingsConfigure network settings for functions in the service. For example, you can configure whether the functions can access the Internet and the resources in VPC. Configure network settings
      Storage ConfigurationConfigure the Apsara File Storage NAS (NAS) file system and Object Storage Service (OSS) file system used by functions in the service. This allows your functions to access files in the NAS file system or OSS file system as they do in the on-premises file system.
Important You can delete services that you no longer need. Before you delete a service, make sure that the service has no functions, provisioned function instances, versions, or aliases. Otherwise, the service fails to be deleted.

Additional information

In addition to the Function Compute console, you can also use Serverless Devs or call API operations to manage services. For more information, see