Deploy .NET Core applications

Updated at:

Package your .NET Core application into a ZIP file that meets Serverless App Engine (SAE) requirements, and then deploy the package to SAE.

Procedure

  1. On the SAE Application List page, select the target region and namespace in the top navigation bar, and then click Create Application.

  2. Select an application edition.

    Important

    The Lightweight Edition and Professional Edition are in an invite-only beta testing phase. If you are not part of the beta test, the application is created as the Standard Edition, and you do not need to select an edition.

    • Lightweight Edition: Provides the minimum feature set required to run an application. It does not support the Application Monitoring or Microservices Governance features.

    • Standard Edition: Includes the Basic Application Monitoring feature. The Advanced Application Monitoring and Microservices Governance features must be enabled and purchased separately.

    • Professional Edition: Includes the Advanced Application Monitoring and Microservices Governance features. They do not need to be enabled or purchased separately.

  3. On the Create Application page, set the Application Name and configure the following parameters.

    1. Select the namespace type for the application. A namespace is equivalent to a Kubernetes namespace and can be used to isolate resources in different environments. You cannot change the namespace of an application after it is created. Plan accordingly.

      • System Created: Use the default namespace, vSwitch, and security group created by the system in the current region.

      • Existing Namespace: Select the Create a namespace, Create and manage vSwitches, and Security Group that you previously created.

    2. For Application Deployment Method, select Code Package-based Deployment and click Configure Code Package-based Deployment on the right. For Technology Stack Programming Language, select .NET Core. Select a .NET Core environment that is compatible with your code. Configure the following parameters and click OK.

      Parameters - Configure a .NET Core ZIP package

      Parameter

      Description

      Upload Method

      Upload a local code package or enter the URL of a code package.

      Version

      Enter a version number for the application or select Use Timestamp as Version Number.

      Time Zone Settings

      Select the time zone for the application.

      Startup Command

      Enter a startup command. Example:

      # The startup script ./start.sh in the ZIP package corresponds to /home/admin/start.sh in the SAE application instance runtime environment.
      /home/admin/start.sh

      Custom Runtime Environment Settings

      (Optional) After you enable this feature, you can pre-install tools, download or modify files, and install runtime dependencies or extensions for the application as needed.

      Customize The Runtime Environment Using The Command Line: The following are examples.

      CentOS-based runtime environment

      #!/bin/bash
      
      # Install vim
      yum install -y vim

      Debian-based runtime environment

      #!/bin/bash
      
      # Install vim
      apt install vim

      Alpine-based runtime environment

      #!/bin/bash
      
      # Install vim
      apk add vim
    3. In the Capacity Settings section, set Resource Type, Single Instance Type, and Instances.

      Metric description - Resource Type

      Resource Type includes Default and Hygon. Hygon is in an invite-only beta testing phase. If you are not part of the beta test, Resource Type is automatically set to Default, and you do not need to select it manually.

      To deploy an application using Hygon resources, contact the relevant technical staff in the DingTalk group (ID: 32874633) to enable it. You also need to select a region and zone that support Hygon resources:

      • Shanghai region: Supports Zone B, Zone G, and Zone L.

      • Beijing region: Supports Zone H and Zone I.

      • Hangzhou region: Supports Zone B.

  4. (Optional) Click Next: Advanced Settings and configure the required features.

  5. Click Create Application with One Click or Create Application.

    • The application takes about 1 to 2 minutes to create. You can check the View change records to verify that the deployment was successful. If the deployment fails, an application instance is not created. You can troubleshoot the issue using the error message in the Change Details.

    • You can view the created application on the Applications > Applications page. To change the application configuration after deployment, click the target application to go to its details page. Then, in the top navigation bar, click Deploy Application or Modify Application Configurations. Note that the application automatically restarts for the new configuration to take effect. We recommend that you perform this operation during off-peak hours.

    • You can Diagnose applications with a webshell and interact with the application instance using console commands.

    • After you create an application, you can Manual scaling and the Change instance specifications, or automatically adjust the number of instances by Configure auto scaling policies. You can also reduce costs by Idle mode (invitational preview).