This topic describes how to create an HTTP trigger in the Function Compute console.
- Log on to the Function Compute console.
- In the top navigation bar, select a region.
- In the left-side navigation pane, click Service/Function.
- Click Create Function.
- On the Create Function page, choose .
- Configure the function.In the Configure Function section, set parameters as required.
Parameter Settings Example Service Name Select the target service from the drop-down list. service Function Name Enter the name of the function. function Runtime Select a language that you are familiar with, such as Python, Java, PHP, or Node.js. python3 Function Handler Enter the function handler. The value is in the format of [File name].[ Function name]. index.handler Memory Set memory for function execution. The default value is 512 MB. The maximum value is 3072 MB. 512 MB Timeout Configure a timeout period. The default value is 60 seconds. The maximum value is 600 seconds.
If the specified timeout period expires, the function fails to run.
60 Single Instance Concurrency The number of requests that can be concurrently processed by a single Function Compute instance. This parameter is unavailable for Python.
- Configure the trigger.In the Configure Trigger section, set parameters as required.
Parameter Settings Example Trigger Name Enter the name of the trigger. HTTP-Trigger Authorization Select an authorization type. Valid values:
- anonymous: If this option is selected, no authorization is required, anonymous access is supported, and the security level is low. That means anyone can send an HTTP request to call your function.
- function: If this option is selected, authorization is required, anonymous access is not supported,
and the security level is high. For more information, see Authorization.
Note Authorization and Date information needs to be passed in the HTTP request header. In this case, Date is in GMT format and is involved in the signature calculation. The server will calculate the signature based on the value of Date and compare it with the passed Authorization value. If the signature is the same as the Authorization value and the difference between the current time and the value of Date is less than 15 minutes, the authorization is passed.
anonymous Method The request method supported by the HTTP trigger. You can choose multiple methods. Valid values:
- Click Create.The created function is displayed under the target service.Click the target function and then click the Triggers tab. The created HTTP trigger is displayed in the trigger list.