Skip to main content

Create CloudBase Environment

A CloudBase environment is the foundation of your application's backend services. Each environment is isolated from others, has a unique environment ID, and contains independent database instances, storage space, cloud function configurations, and other resources.

Choose Your Setup Method

Choose the appropriate setup method based on your development scenario:

  1. Open WeChat Developer Tools and click the "CloudBase" button at the top

  1. Follow the prompts to activate the CloudBase environment when entering for the first time
Tip
  • The initially created environment automatically becomes the default environment
  • After starting to create an environment, you need to wait a few minutes for resource initialization
tip

CloudBase provides a free development environment for new users, which is free during development but requires payment for production use. However, the free environment has some functional limitations. If you need more features, it's recommended to upgrade to the paid version. For detailed information, please refer to the Pricing Documentation

  1. Go to CloudBase Console, check the service terms, and click "Free Development, Start Intelligent Applications"

  1. Authorize the CloudBase service role permissions

  1. After authorization is complete, the system will automatically provision the Personal Free Tier, a new environment for free trial, and open the CloudBase platform

Environment Management

After creating an environment, you can manage it through the following methods:

CloudBase Console

Visit CloudBase Console for environment management, resource configuration, and other operations.

CloudBase Platform (Visual Management)

Visit CloudBase Platform for visual data management, content management, and other operations.

Associate WeChat Mini Program

In some cases, you may want to use a CloudBase environment created on the Tencent Cloud side in WeChat Developer Tools, using CloudBase services as the backend resource for your Mini Program. In that case, you need to first perform the association operation, following these steps:

Step 1: Log in to the Console

Log in to CloudBase Console, in the username dropdown menu in the upper right corner of the menu bar, click Account Info to enter the account center.

⚠️ Note: If you are currently logged in as a sub-account, you need to switch to the main account for login.

Step 2: Associate Login Method

In Login Methods, click Associate on the right side of WeChat Official Accounts Platform

Step 3: Authorization

After logging in with WeChat using the QR code that appears, click "Go to Authorize" in the account association window that pops up

Follow the prompts to complete the authorization operation, and you can complete the account association.

Step 4: Open WeChat Developer Tools and Enter CloudBase Console

Next, to use this environment in WeChat Developer Tools, you can perform environment conversion to convert the cloud-side created environment to a WeChat Mini Program environment.

Open Developer Tools and enter CloudBase Console

Step 5: Environment Conversion

  1. In the CloudBase Console, enter "Settings", drop down the "Environment Name" list, and click "Manage My Environments"

  1. To use an existing cloud environment, in the "WeChat Developer Tools > Environment Management" sidebar, click Use Existing Tencent Cloud Environment
  1. Select an environment for conversion, choose the cloud-side environment you need to convert, confirm the environment conversion, and scan the code to complete verification. The conversion will be successful.

Next Steps

After the environment is set up, please choose the corresponding quick start guide based on your development needs:

FAQ

Can I create multiple resource environments?

A resource environment is a collection of resources used during Mini Program development, including databases, file storage, etc. The resources of each environment are independent and isolated from each other. You can create multiple environments according to your needs for development, testing, production, and other scenarios. If you have multiple applications corresponding to different business data, you also need to create multiple environments. Currently, on the WeChat side (WeChat Developer Tools), you can create two free environments, and on the Tencent Cloud side, you can create one free environment.

Can different clients use the same resource environment?

Currently, environments created on the WeChat side support the development of Mini Program and Web sides; environments created on the Tencent Cloud side currently only support the development of the Web side.

What to do when the environment's API call limit is reached?

To ensure reasonable use of resources, CloudBase has limits on the number of API calls for each environment. The call count for each environment is calculated independently and is counted on a daily basis.

  • When the daily API call count exceeds 80% and 90%, notifications will be sent through different channels such as WeChat, SMS, internal messages, and email. If you are developing a Mini Program and this alert is triggered on the WeChat side, the sending channel will be WeChat; otherwise, it will be Tencent Cloud. You can upgrade your environment version to enjoy more API call quotas and avoid affecting normal business operations.
  • If the daily API call limit has been exhausted, calling the API will result in an error [API call limit reached]. The call count will reset the next day and return to normal.

What is the concept of CloudBase environment, how to switch between different environments, and how to synchronize data

Switching between different environments in the SDK only requires passing the corresponding env parameter during init. Cloud functions and file storage can use CLI tools to simplify cross-environment data copying functionality. For databases, you still need to export from the console and then import to the target environment.

What is the relationship between Mini Program side and Tencent Cloud side CloudBase

Both are supported by Tencent Cloud. Currently, there are the following differences: environments created on the Mini Program side can be accessed on both sides (except for cloud function management); environments created on the Tencent Cloud side can only be accessed on the Tencent Cloud side.

Is it possible to manage CloudBase without the cloud console

Use the command-line tools provided by CloudBase to manage CloudBase resources.

How to migrate CloudBase environment across accounts

CloudBase environments do not support cross-account migration. For data migration, please refer to Data Migration