You can migrate your code from Function Studio to Apsara Devops, a one-stop BizDevOps platform, for centralized management by associating Function Studio with a remote Apsara Devops repo. This topic describes the migration process.
Background information
Function Studio is used to develop MaxCompute functions. You can also use the following methods to develop MaxCompute functions.
Method description |
Additional information |
References |
Method 1: Develop custom User-Defined Functions (UDFs) using Java or Python code in a local MaxCompute software development kit (SDK) environment. |
After local development, you can package and upload the resources to DataWorks, and then register the functions. |
|
Method 2: Develop custom UDFs using Java or Python code in IntelliJ IDEA with the MaxCompute Studio plug-in installed. |
After local development, you can directly upload and add the resources and functions to the corresponding MaxCompute project. To manage them visually in DataWorks, you must load the MaxCompute resources and functions into DataWorks. |
|
Method 3: Develop embedded UDFs by embedding Java or Python code in SQL scripts using the MaxCompute script mode. |
Embedded UDFs allow you to embed Java or Python code in SQL scripts. The Janino compiler detects and extracts the embedded code, compiles it, dynamically generates resources, and creates temporary functions. This method simplifies complex implementation processes and improves code readability and maintenance. |
Usage notes
Function Studio only supports pushing code to Apsara Devops, a one-stop BizDevOps platform.
All basic features of Apsara Devops are free to use for an unlimited number of users. For more information about Apsara Devops features and billing, see Billing (central version).
Procedure
The process of migrating Function Studio code to the Apsara Devops platform includes the following steps:
Step 2: Configure the SSH public key of the project in the Apsara Devops code repository
Step 3: Associate Function Studio with the remote Apsara Devops repo
After the migration is complete, if you want to continue to use the UDFs in DataWorks, see Follow-up: Continue to manage and use UDFs in DataWorks.
Step 1: Create a code repository in Apsara Devops
Go to the Apsara Devops code repository platform and create a code repository to store your Function Studio code. This repository serves as the remote repo for the code that you migrate from Function Studio. For more information, see Create a code repository. In this example, a code repository named Demo2023_Function is created.
Step 2: Configure the SSH public key of the project in the Apsara Devops code repository
Obtain the SSH public key of the project that contains the code to be migrated.
Go to Function Studio.
Go to Data Studio. In the upper-left corner of the Data Studio page, click the
icon and choose .Obtain the SSH public key of the project in Function Studio.
Open the project that you want to migrate. In this example, the project is named Demo_2023_jar. Obtain the SSH public key as shown in the following figure.

Go to the SSH key management page.
In the Demo2023_Function code repository in Apsara Devops, go to the SSH key management page as shown in the following figure.

Configure the key for the Apsara Devops code repository.
Add the SSH public key that you obtained to the Apsara Devops code repository, as shown in the following figure.
Step 3: Associate Function Studio with the remote Apsara Devops repo
Obtain the SSH address of the code repository.
Go to the Demo2023_Function code repository in Apsara Devops and obtain the SSH address as shown in the following figure.

Associate Function Studio with the remote Apsara Devops repo.
Go to Function Studio.
Go to Data Studio. In the upper-left corner of the Data Studio page, click the
icon and choose .Configure the association address.
In the Associate Remote Repo dialog box, enter the SSH address of the Demo2023_Function code repository in Apsara Devops, as shown in the following figure. After the association is configured, you can push code from Function Studio to the associated remote Apsara Devops repo.

Step 4: Push the code to the remote Apsara Devops repo
Push the code.
In the Demo_2023_jar project in Function Studio, push the code to the Demo2023_Function code repository in Apsara Devops as shown in the following figure.

Confirm the result.
Go to the Demo2023_Function code repository in Apsara Devops and confirm that the code was pushed.

Follow-up: Continue to manage and use UDFs in DataWorks
To continue using DataWorks tasks associated with a remote repo on the Apsara DevOps platform, follow the steps below.
Export the code from the Apsara Devops platform to your local machine.
Compile and package the code on your local machine.
Upload the resource package to DataWorks using the visualization feature, and then use the package to register the function. For more information, see Create and use MaxCompute resources and Register a function using the resource visualization feature.


