tencent cloud

最終更新日:2025-05-09 10:05:01
Creating a Function URL
最終更新日: 2025-05-09 10:05:01
This document introduces how to create a function URL using the console and using API.

Creating a Function URL through the Console

1. Log in to Serverless Console, click Function Service in the left sidebar.
2. On the Function Service page, click the function name to enter the function detail page.
3. Select Function URL in the left sidebar, and click Create Function URL. As shown below:

4. On the Create Function URL page, refer to the following information to proceed with creation.

Configuration Item
Description
Alias / Version
URL can be bound at the alias or version dimension. Each alias or version can create only one URL.
Public network access / Private network access
You can enable public network or private network URL visit based on business needs.
Authorization type
The authorization type supports selecting Open and CAM Authentication.
Open: No identity verification is required for function requests. Anonymous access is supported. Anyone can initiate an HTTP call to your functions.
CAM authentication: Authentication validation is required for functions via CAM. Users can perform resource management and usage rights configuration based on the function InvokeFunctionUrl API. For details, see Function URL Authentication and Authorization Configuration.
5. Click Submit to complete the creation.

Using API to Create a Function URL

Creating function URLs and triggers shares the same API interface. For details on shared parameters, see Set Function Trigger Method. For the Type parameter, please enter http. The configuration instructions for the TriggerDesc parameter are as follows:
Name
Type
Required
Description
AuthType
String
Yes
Authorization type. CAM indicates that function URL authentication and authentication configuration is required. NONE means authorization is not required.
NetConfig
NetConfig
Yes
network access configuration. Example value: { "EnableIntranet": true, "EnableExtranet": false }

NetConfig

Name
Type
Required
Description
EnableIntranet
Bool
Yes
Whether intranet access is enabled
EnableExtranet
Bool
Yes
Whether to enable public network access

Parameter example

trigger_desc = {
"AuthType": "NONE",
"NetConfig": {
"EnableIntranet": true,
"EnableExtranet": false
}
}
params = {
"FunctionName": "helloworld",
"TriggerName": "func_url",
"TriggerDesc": json.dumps(trigger_desc),
"Type": "http",
"Namespace": "default",
"Enable": "OPEN",
}


この記事はお役に立ちましたか?
営業担当者に お問い合わせ いただくか チケットを提出 してサポートを求めることができます。
はい
いいえ

フィードバック