You can use .NET Core to write functions in a custom container of Function Compute. This topic describes how to deploy and invoke a .NET Core function. You can also modify the .NET Core sample code as needed for custom development.


  1. Run the following command in the specified directory to initialize a project:
    s init start-fc-custom-container-http-aspdotnetcore -d start-cc-http-aspdotnetcore
    Note -d specifies the name of the folder in which the sample project resides. You can customize the folder name as required.
  2. Run the following command to go to the project directory:
    cd start-cc-http-aspdotnetcore
  3. Optional: Modify the sample code as needed for custom development.
  4. Modify the s.yaml file.
    Change the value of the image field in the s.yaml file to your image name.
  5. Run the following command to deploy the project:
    s deploy -y
    Sample command output:
    [2022-02-09 07:25:48] [INFO] [S-CLI] - Start the pre-action
      region:   cn-hangzhou
        name: hello-world-service
        name:       aspdotnetcore-http-function
        runtime:    custom-container
        handler:    not-used
        memorySize: 512
        timeout:    60
        system_url:    https://188077086902****
            domain: http://aspdotnetcore-http-function.hello-world-service.188077086902****
          type: http
          name: httpTrigger


After the project is deployed, you can view the temporary domain name that is generated by Function Compute in the output. The temporary domain name can be used to access the newly deployed application. For example, run the following command to access the application:

curl -v  http://aspdotnetcore-http-function.hello-world-service.188077086902****
Note You can use the temporary domain name only for demonstration and development purposes. It is valid for a limited period of time. In a production environment, you must use a domain name for which an Internet Content Provider (ICP) filing is obtained from Alibaba Cloud. For more information, see Configure a custom domain name.