tencent cloud

Serverless Cloud Function

Release Notes and Announcements
Release Notes
Announcements
User Guide
Product Introduction
Overview
Related Concepts
How It Works
Strengths
Scenarios
Related Products
Purchase Guide
Billing Overview
Billing Mode
Billable Items and Billing Modes
Function Computing Power Support
Free Tier
SCF Pricing
Billing Example
Payment Overdue
Getting Started
Creating Event Function in Console
User Guide
Quota Management
Managing Functions
Web Function Management
Log Management
Concurrence Management
Trigger Management
Function URL
A Custom Domain Name
Version Management
Alias Management
Permission Management
Running Instance Management
Plugin Management
Managing Monitors and Alarms
Network Configuration
Layer Management
Execution Configuration
Extended Storage Management
DNS Caching Configuration
Resource Managed Mode Management
Near-Offline Resource Hosting Model
Workflow
Triggers
Trigger Overview
Trigger Event Message Structure Summary
API Gateway Trigger
COS Trigger
CLS Trigger
Timer Trigger
CKafka Trigger
Apache Kafka Trigger
MQTT Trigger
Trigger Configuration Description
MPS Trigger
CLB Trigger Description
TencentCloud API Trigger
Development Guide
Basic Concepts
Testing a Function
Environment Variables
Dependency Installation
Using Container Image
Error Types and Retry Policies
Dead Letter Queue
Connecting SCF to Database
Automated Deployment
Cloud Function Status Code
Common Errors and Solutions
Developer Tools
Serverless Web IDE
Calling SDK Across Functions
Third-Party Tools
Code Development
Python
Node.js
Golang
PHP
Java
Custom Runtime
Deploying Image as Function
Web Framework Development
Deploying Framework on Command Line
Quickly Deploying Egg Framework
Quickly Deploying Express Framework
Quickly Deploying Flask Framework
Quickly Deploying Koa Framework
Quickly Deploying Laravel Framework
Quickly Deploying Nest.js Framework
Quickly Deploying Next.js Framework
Quickly Deploying Nuxt.js Framework
Quickly Deploying Django Framework
Use Cases
Overview
Solutions with Tencent Cloud Services
Business Development
TRTC Practices
COS Practices
CKafka Practice
CLS
CLB Practice
MPS
CDN
CDWPG
VOD
SMS
ES
Scheduled Task
Video Processing
Success Stories
Tencent Online Education
Online Video Industry
Tencent Online Education
Best Practice of Tencent IEG Going Global
API Documentation
History
Introduction
API Category
Making API Requests
Other APIs
Namespace APIs
Layer Management APIs
Async Event Management APIs
Trigger APIs
Function APIs
Function and Layer Status Description
Data Types
Error Codes
SDK Documentation
FAQs
General
Web Function
Billing FAQs
Network FAQs
Log FAQs
SCF utility class
Event Handling FAQs
API Gateway Trigger FAQs
Related Agreement
Service Level Agreement
Contact Us
Glossary

User Guide

PDF
포커스 모드
폰트 크기
마지막 업데이트 시간: 2024-12-02 20:27:11
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 Cloud Framework, or TencentCloud API.

2. SCF Billing

New SCF users are entitled to a certain monthly free tier within three months of activation. SCF can be billed in a prepaid (subscription package) or postpaid (pay-as-you-go) manner in USD. To learn more about the resource fees incurred during use of SCF, see Billing Overview.

3. Using SCF

3.1 Register on Tencent Cloud

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

3.2 Role authorization

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

SCF provides two function types: Event-triggered function and HTTP-triggered function. For more information, see Creating and Updating Function and Creating and Testing Function.
SCF provides two function creation methods. You can quickly create a function in the console as instructed in Creating Event-Triggered Function in Console. You can also create a function through Serverless Cloud Framework as instructed in Creating Function on CLI.

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 Trigger Management. 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 Management.
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 abnormal. For more information, see Managing Monitors and Alarms.

4. Beginner's Guide

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

As a new function type, HTTP-triggered 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 Suggestion

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:
For questions about the product documentation, such as links, content, or APIs, click Send Feedback on the right of the document page.
If you encounter any problems while using the product, submit a ticket for assistance.

도움말 및 지원

문제 해결에 도움이 되었나요?

피드백