tencent cloud

Feedback

User Guide

Last updated: 2022-03-15 18:56:13

    This document helps you quickly get start with Serverless Cloud Function (SCF).

    1. SCF Overview

    Tencent Cloud Serverless Cloud Function (SCF) is a serverless execution environment that enables you to build and run applications without having to purchase and manage servers. Simply code in a supported language and set the execution conditions, and your code can be run on the Tencent Cloud infrastructure elastically and securely.

    SCF allows you to develop, deploy, and test functions through the SCF console, Serverless Framework, or TencentCloud API.

    2. SCF Billing

    SCF users are entitled to a certain free tier of resource usage and invocations each month as shown below. SCF is billed by the actual Tencent Cloud resource usage and settled hourly in USD. You need to understand the resource fees incurred during use of SCF. For more information, see Billing Overview.

    3. Using SCF

    3.1 Registering account and verifying identity

    Before using SCF, you need to sign up for a Tencent Cloud account and complete identity verification first.

    3.2 Authorizing role

    You need to authorize the current service role and grant operation permissions for SCF before accessing your other Tencent Cloud service resources.
    Log in to the Tencent Cloud console, select Products > Serverless Cloud Function to enter the SCF console, and follow the prompts to authorize SCF. After completing service authorization to get the relevant resource operation permissions, you can start creating functions.

    3.3 Creating function

    3.4 Deploying function

    After editing the function code online, click Save, and the function will be deployed. After the code is deployed in the cloud, SCF can execute the function after a trigger condition is configured. An execution condition of a function is called a trigger. You can configure various types of triggers, such as timer, API Gateway, and COS triggers. For detailed directions on how to configure a trigger, see Creating Trigger. SCF currently supports two trigger modes: event-triggered and HTTP-triggered. For more information, see Trigger Overview.

    3.5 Invoking and testing function

    You can directly invoke a function and simulate the triggering event sent by the trigger in the SCF console, and the test result will display the function execution conditions, returned content, and execution log. For more information, see Testing Function.

    3.6 Managing function

    • View logs: SCF supports displaying historical or real-time function logs in various ways. For more information, see Log Search Guide.
    • View monitoring data and configure alarms: you can stay on top of the function running status by viewing monitoring metrics. You can also configure alarms for functions to promptly receive alarm messages when your business is exceptional. For more information, see Descriptions of monitoring metrics.

    4. FAQs

    What are the differences between HTTP-triggered function and event-triggered function?

    As a new function type, HTTP-triggered function can be directly triggered by HTTP requests, breaking through the limit of JSON event format required by the current event-triggered function type. It has more flexible application scenarios and delivers a development experience much similar to that of native web services.

    A function can run normally in the local system, but I am prompted that some dependencies cannot be found when I try to run it online. What should I do?

    A common reason is that third-party dependencies have not been packaged and uploaded to the online environment. You can install the dependencies and run the function again for test.

    Can I use a local code base?

    Yes. You can add your own code repository to the function code and upload it to the platform as a zip package.

    Can SCF interconnect with other Tencent Cloud services such as CVM or TencentDB?

    Yes. When you create or modify a function, select VPC configuration and deploy the function in the same VPC as the CVM or TencentDB instance.

    How can I use a custom domain name?

    You can bind your independent domain name to the SCF service, so that the service can be accessed at it. For more information, see Configuring a Custom Domain Name. Then you can select Use Existing API Service to create an API Gateway trigger for a function that requires a custom domain name.

    5. Feedback and Suggestions

    If you have any questions or suggestions about SCF, you can send your feedback through the following channels, and we will get back to you accordingly:

    • If you have any questions regarding the product documentation, such as links, content, or APIs, click Send Feedback on the right of the document page.
    • If you encounter problems when using the product, submit a ticket for assistance.
    Contact Us

    Contact our sales team or business advisors to help your business.

    Technical Support

    Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

    7x24 Phone Support