What is a service?
From a business perspective, an application consists of multiple services. From a resource usage perspective, a service consists 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
Log on to the Function Compute console. In the left-side navigation pane, click Services & Functions.
In the top navigation bar, select a region. On the Services page, click Create Service.
In the Create Service panel, enter the service name and description, configure other parameters, and then click OK. The following table describes the parameters.
Parameter | Description | Example |
Parameter | Description | Example |
Logging | Specifies whether to enable the logging feature. Valid values: Enable: Function Compute sends function execution logs to Simple Log Service for persistent storage. You can debug code, troubleshoot issues, and analyze data based on the logs. Disable: You cannot use Simple Log Service to store or query function execution logs.
| Enable |
Advanced options |
Managed Service for OpenTelemetry | Specify whether to enable Managed Service for OpenTelemetry. Valid values: Enable: enables Managed Service for OpenTelemetry. 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 of Managed Service for OpenTelemetry. Disable: disables Managed Service for OpenTelemetry.
| Enable |
Server Role | Configure the role for functions in the service. This way, 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 VPC | Specifies whether to allow functions to access virtual private cloud (VPC) resources. For more information, see Configure network settings. | Yes |
VPC | This parameter is required if you set the Access to VPC parameter 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**** |
vSwitch | This parameter is required if you set the Access to VPC parameter 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 Group | This parameter is required if you set the Access to VPC parameter 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 Internet | Specifies 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 over 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 the Access to Internet parameter to No. Otherwise, the configured static public IP address does not take effect. For more information, see Assign a static public IP address. | Yes |
After the service is created, you can click Services & Functions to view the created service on the Services page.
Update a service
Log on to the Function Compute console. In the left-side navigation pane, click Services & Functions.
In the top navigation bar, select a region. On the Services page, find the desired service and click Configure in the Actions column.
On the Modify Service page, configure the parameters based on your business requirements and click Save.
Important
You can delete services that you no longer require. Before you delete a service, make sure that the service has no functions, provisioned function instances, versions, or aliases. Otherwise, the service cannot be deleted.
More information
In addition to the Function Compute console, you can also use Serverless Devs or call the Function Compute API to manage services. For more information, see the following topics:
References
Function Compute allows you to specify a version and an alias for a service. You can use versions and aliases to implement canary release. For more information, see Use versions and aliases to implement canary release.
After you create a service, you also must create functions, the smallest resource unit in Function Compute, to implement specific business logic. For more information, see Manage functions.