Quickly deploy a web project to Function Compute by using a template

更新时间:
复制 MD 格式

This topic describes how to use Cloud Application Platform to quickly host a Spring Boot framework on Function Compute FC and simplify the initial setup process for Spring applications.

Scenario overview

Alibaba Cloud products used

Function Compute (FC)

Billing

Deploying the project is free. Accessing the project incurs Function Compute fees. For more information, see Billing overview.

Procedure

Step 1: Claim a free trial

  1. Go to Alibaba Cloud Free Trial. Click the Log On/Sign Up button in the upper-right corner of the page. Follow the on-screen instructions to log on with an existing Alibaba Cloud account, sign up for a new account, or complete real-name verification (personal or enterprise verification, as required by the product).

  2. Under Product Category, choose Compute > Serverless, and then select Function Compute FC. Check if you meet the free trial requirements. If you meet the requirements, click Try Now, and then follow the instructions to activate Function Compute and claim the free trial package. If you do not meet the requirements, proceed to the next step.

Step 2: Deploy the project

  1. (Optional) The first time you log on to the Cloud-native Application Platform (CAP) console, complete the quick authorization for CAP.

  2. Choose Explore > Web Application Frameworks > SpringBoot to go to the SpringBoot template details page.

  3. On the Template Details page, click Deploy Now to start the project deployment.

  4. Enter the Project Name, Region, and Function Name, and then click Deploy Project.

    In this example, Project Name is set to start-springboot, Region is set to China (Hangzhou), and Function Name is set to springboot-0a41.

  5. In the Preview Project Resources dialog box that appears, you can see the cloud resources that will be created. Click Confirm Deployment to start deploying the project.

    The dialog box shows that the Function Compute FC service is activated and uses the pay-as-you-go billing method (free deployment, pay for what you use). After you confirm the deployment, the system automatically creates a project and a production environment. In the production environment, the system creates the services predefined in the template and deploys all services.

  6. On the Project Details page, you can view the deployment status and logs.

    After the deployment is successful, the service status changes to Deployed, and a green check mark appears next to the start_springboot service in the service list on the left. The details area on the right displays information such as the function name, public endpoint, and region. Select the Deployment History tab to view the deployment version, duration, and the deployment log output at the bottom.

Step 3: Access the project

  1. On the project details page, select the Access URL tab, and then click the Custom Domain Name to access the project.

    A successful access attempt displays the following information.

    {
      "msg": "Hello, World! at 2024-09-06 07:01:50",
      "request": {
        "path": "/",
        "query": "{}",
        "clientIp": "xxx"
      }
    }

Step 4: Clean up resources

  1. In the navigation pane on the left, choose Projects. In the project list, find the target project and click Delete in the Actions column.

  2. In the Delete Project dialog box, select the services and cloud resources to delete, enter the project name for confirmation, and select the I understand that deleting this project and selected services will immediately and irreversibly interrupt their online services and permanently delete dependent cloud resources. checkbox. Then, click Confirm Deletion.

    Note

    If you want to delete only the project but retain the created cloud resources, do not select the specified services.

好的,我将作为一名追求极致简洁的文案本地化专家,开始处理您的 DITA/Lake 格式 HTML 文档。 我将严格遵循您设定的工作流和核心约束,仅对 进行优化,并保持其余所有内容的原始状态。 : 1. : 文档中不包含 或 ,跳过此步骤。 2. : 文档中不包含 ,跳过此步骤。 3. : * 和 : 原文 超过 7 个单词,根据 需要重写。优化为更简洁、更主动的 。 * / : 简洁明了,无需修改。 * : 已根据 删除了说明 (Description),是优秀的压缩,无需修改。 * : 格式正确,内容简洁,无需修改。 4. : 所有正文、列表、代码块、ID 及 HTML 属性将严格保持原样。 : html