Help Center/ FunctionGraph/ User Guide/ Deploying the Function Application Using a Template
Updated on 2025-08-19 GMT+08:00

Deploying the Function Application Using a Template

Application Center uses Resource Formation Service (RFS) to deploy peripheral resources (including functions, agencies, and triggers) required by applications so that these resources can cooperate with each other to execute tasks

Overview

FunctionGraph provides function templates for different scenarios. When you create a function using a template, the template automatically configures the function code, environment variables, and triggers.

You can filter function templates by runtime and scenario. Click Learn More of a function template to view the usage description and precautions of the template as shown in Figure 1.

Figure 1 Template details

Billing

You are not charged for creating applications. However, other cloud service resources may be created during application creation. For details about the billing of other cloud services, see the billing description of each cloud service.

Notes and Constraints

Currently, the application center is supported only in the CN North-Beijing4, CN East-Shanghai1 regions.

Prerequisites

If FunctionGraph needs to access other cloud services such as LTS and VPC, you need to create an agency and assign permissions by referring to Creating a Function Agency

Creating an Application

  1. Log in to the FunctionGraph console. In the navigation pane, choose Apps.
  2. Click Create in the upper right corner. The Templates page is displayed.
  3. The Django template is used as an example. After selecting the template, click Create Application, as shown in Figure 2. The application configuration page is displayed.

    Figure 2 Selecting a template

  4. On the Create Application page, set basic information by referring to Table 1 and click Create Now.

    Table 1 Parameters in the Django template

    Parameter

    Description

    Example Value

    Template

    The selected function template is displayed by default.

    To change it, click Reselect.

    Django

    Region

    Region where the function application is created.

    By default, the current region is selected. To change it, return to the FunctionGraph console and switch the region in the upper left corner.

    CN East-Shanghai1

    Application Name

    Enter a function application name.

    The value can contain 2 to 60 characters, starting with a letter and ending with a letter or digit. Only letters, digits, underscores (_), and hyphens (-) are allowed.

    django-framework

    Runtime

    The runtime language of the function application template, which cannot be changed.

    http

    Agency

    Select an agency for FunctionGraph.

    If Use no agency is selected, the system will use agency fgs-app-adminagency, or create it if not available.

    fgs-app-adminagency

    Create Repository

    When enabled, you can create a code repository in CodeArts Repo to update and deploy your application code.

    Enabled

    Project

    The CodeArts Req project where a code repository will be created. A new project will be created if this is not specified.

    -

    Description

    Enter a description of the application. The description can contain a maximum of 1,024 characters.

    -

    APIG Instance

    Select an available APIG gateway. If no gateway is available, click Create Instance on the right to go to the creation page.

    apig-fg

  5. After the application is created, the required function resources and gateway resources are automatically created, as shown in Figure 3. You can click the link under Physical Resource Name/ID to go to the resource details page.

    Figure 3 Application created successfully

Common Problems and Troubleshooting Methods

Table 2 Troubleshooting methods for common problems

Issue

Troubleshooting Method

The code repository fails to be created, and the message shown in Figure 4 is displayed.
Figure 4 Code repository creation failed

Check whether CodeArts is enabled for your account. For details, see Login Methods to check and enable CodeArts.

If the problem persists, submit a service ticket to contact Huawei Cloud FunctionGraph engineers for further help.

The stack fails to be deployed, and the message shown in Figure 5 is displayed.
Figure 5 Stack deployment failed
  1. Click the application name to go to its details page. Click the resource stack name to go to the RFS console.
    Figure 6 Application details page
  2. On the RFS page, click View Failure Causes to view the detailed issue.
    Figure 7 RFS page
    Figure 8 Viewing failure causes
If the permission is insufficient, the message shown in Figure 9 is displayed.
Figure 9 Insufficient permissions

If an error message indicating insufficient permissions is displayed when you create an application for the first time, configure the agency permission for the current account by referring to Configuring Agency Permissions and try again.

If the deletion fails, the message shown in Figure 10 is displayed.
Figure 10 Deletion failed
  1. Click the application name to go to the details page. Click the resource stack name to go to the RFS console.
  2. Click View Failure Causes to view the specific problem. Take Figure 10 as an example, the deletion fails because the API group contains APIs.
  3. Go to the details page of the application, and click the Physical Resource Name/ID link of FunctionGraph to access the function details page.
    Figure 11 Clicking the FunctionGraph link
  4. Choose Configuration > Triggers to view the API name.
    Figure 12 Viewing the API name
  5. Log in to the APIG console, take the API offline, delete the API, and try again.