1 -> Deploy the cloud-side project
After all SCF and CDB are developed, you can deploy the entire cloud project resources to the AGC cloud.
- Right-click on the CloudProgram and select Deploy Cloud Program.
- You can view the packaging and deployment progress of the cloud project on the right side of the status bar at the bottom.
Wait patiently until the "Deploy successfully" message appears, indicating that the cloud project has been successfully deployed.
- Select Tools > CloudDev in the menu bar.
- In the CloudDev panel that opens, click Go to console to open the AGC Serverless sub-console of the current project.
- Go to the SCF and TencentDB menus respectively to view the SCF and TencentDB resources that you just deployed.
2 -> Obtain cloud development resource support through the CloudDev panel
DevEco Studio provides the CloudDev cloud development management panel. This panel integrates the AGC Cloud Development Sub-Console, Documentation, and Community Portal, allowing you to directly access the AGC Cloud Development Sub-Console for service and resource management, and easily jump to various guidance documents and community forums to obtain technical support, providing an end-to-end experience of development, commissioning, deployment, management, and technical support.
- Select Tools > CloudDev in the menu bar.
- In the open cloud development management panel, you can easily access various cloud development resources.
illustrate
If you have not already logged in, click Sign in to log in to your Huawei developer account.
As shown in the figure below, you can access the corresponding menu for service or resource management on demand.
3-> Generic cloud development template
3.1 -> Scope of application
3.2 -> Renderings
The following is the rendering of the main functional modules of the general cloud development template.
4 -> Summary
To deploy a HarmonyOS cloud-side project on DevEco Studio, you need to download and install DevEco Studio from the official website of the Huawei Developer Alliance, select HarmonyOS SDK and Cloud Kit SDK, configure the JDK path, register a Huawei Developer account, and create a project in the HUAWEI CLOUD console to obtain the configuration information.
Next, create a HarmonyOS project, select a Cloud Engine template, add HUAWEI CLOUD service dependencies to the project, and synchronize the Gradle configuration.
When developing cloud-side business logic, create an SCF class in a specified directory, mark methods that can be called remotely with corresponding annotations, integrate specific cloud services such as CloudDB and Object Storage as required, introduce SDK dependencies, and invoke services through the HUAWEI CLOUD client in SCF.
To configure cloud project parameters, you need to add the AppID, Region, and API Key of the cloud service to the config.json, click the Run button to start the local cloud engine debugging environment, use Postman or a browser to verify the SCF results, and use the debugging tool to troubleshoot problems.
During packaging, click Build to generate a deployment package in .hap format, log in to the HUAWEI CLOUD console to upload the deployment package, configure the instance type, complete the deployment, and record the access address.
During joint debugging, you can call SCFs in the CloudClient class in the HarmonyOS client project, monitor the running logs and performance metrics of cloud services in the HUAWEI CLOUD console, and repackage and overwrite the upload if you need to update them.
During the entire process, you need to pay attention to rights management, security hardening, and version compatibility to ensure the smooth deployment and operation of cloud-side projects.
Top comments (0)