All Products
Search
Document Center

DataWorks:Prepare the environment

Last Updated:Sep 24, 2026

Prepare the MaxCompute projects, DataWorks workspace, and data source, compute, and storage configurations required for the user profile analysis scenario in the China (Shanghai) region.

Background

Analyze user behavior on your website by building basic user profiles that cover geographic and social attributes, and run scheduled analyses to support fine-grained traffic operations and business strategy.

Before you begin

Before you start, read the Experiment introduction to understand the user profile analysis workflow.

Notes

  • This tutorial provides user information and website access test data that you can use directly.

  • The provided data is simulated and intended only for hands-on practice with DataWorks.

  • This tutorial uses DataStudio (legacy) for data transformation.

Prepare the MaxCompute environment

1. Activate MaxCompute

This tutorial requires MaxCompute. Activate MaxCompute in the China (Shanghai) region with the following parameters.

  • Region: China (Shanghai)

  • Type: Standard compute resources.

2. Create MaxCompute projects

A DataWorks workspace in standard mode requires two MaxCompute projects: one for the development environment and one for the production environment.

  1. Go to the MaxCompute console. In the left-side navigation pane, choose Manage Configurations > Project management.

  2. Click New Project to create two MaxCompute projects. The following table lists the key parameters for this tutorial. Leave other parameters at their default values. For more information, see Create a MaxCompute project.

    Parameter

    Description

    Project Name

    Custom, must be globally unique.

    Examples in this tutorial:

    • Production environment: workshop2024_01.

    • Development environment: workshop2024_01_dev.

    Billing Method of Computing Resources

    Select Pay-as-you-go for this tutorial.

    Default Quota

    Select the default postpaid quota from the drop-down list for this tutorial.

    Data Type

    Select 2.0 data type (recommended) from the drop-down list for this tutorial.

    Storage Encryption

    Select No encryption for this tutorial.

For more information about creating MaxCompute projects, see Create a MaxCompute project.

Prepare the DataWorks environment

Activate the DataWorks service before you begin. For more information, see Purchase guide.

1. Create a workspace

  1. Log on to the DataWorks console, switch the region to China (Shanghai) at the top, and click Work space in the left-side navigation pane to enter the workspace list page.

  2. Click Create Workspace to create a standard mode workspace (Isolate Development and Production Environments). Do not select Use Data Studio (New Version).

Note
  • After February 18, 2025, when an Alibaba Cloud account activates DataWorks for the first time in the China (Shanghai) region and creates a workspace, the new Data Studio is enabled by default, and the Use Data Studio (New Version) parameter is no longer displayed. If the new Data Studio is enabled by default, see Get started with the new Data Studio for the corresponding tutorial.

For more information about creating a workspace, see Create a workspace.

Step 2. Create a serverless resource group

  1. Purchase a serverless resource group.

    This tutorial requires a DataWorks serverless resource group for data synchronization and scheduling. You must purchase and prepare a serverless resource group.

  2. Log on to the DataWorks resource group list page. In the top navigation bar, switch the region to China (Shanghai). In the left-side navigation pane, click Resource Group to go to the Resource Groups page.

  3. Click Create Resource Group. On the purchase page, set Region and Zone to China (Shanghai) and specify a Resource Group Name. Configure other parameters and complete the payment as prompted. For more information about the billing of serverless resource groups, see Billing of serverless resource groups.

    Note

    If no VPC or vSwitch is available in the current region, click the corresponding console link in the parameter description to create them. For more information about VPCs and vSwitches, see What is a VPC?.

  4. Bind the resource group to your DataWorks workspace.

    You must bind a new serverless resource group to a workspace before using it.

    Log on to the DataWorks resource group list page and switch the region to China (Shanghai). Find the serverless resource group that you purchased. In the Operation column, click Associate Workspace. Then, find the DataWorks workspace that you created and click Associate.

  5. Configure public network access for the resource group.

    This tutorial uses test data that must be accessed from the public internet. By default, a resource group cannot access the public internet. To enable access, you must configure an Internet NAT gateway and add an EIP for the VPC bound to the resource group.

    1. Log on to the VPC - Internet NAT Gateway console. In the top navigation bar, switch the region to China (Shanghai).

    2. Click Create Internet NAT Gatewayand configure the parameters. The following table describes the key parameters for this tutorial. Use the default values for other parameters.

      Parameter

      Value

      Region

      China (Shanghai).

      Network and Zone

      Select the VPC and vSwitch that are bound to the resource group.

      You can go to the DataWorks console, switch the region to China (Shanghai), and then click Resource Group in the left-side navigation pane to go to the Resource Groups page. Find the resource group that you created and click Network Settings in the Operation column. In the Data Scheduling & Data Integration section, you can view the bound VPC and Switch. For more information about VPCs and vSwitches, see What is a VPC?.

      Network Type

      Internet NAT Gateway.

      EIP

      Create an EIP.

      Create service-linked role

      If you are creating an Internet NAT gateway for the first time, you must create a service-linked role. Click Create Service-Linked Role.

    3. Click Buy Now, agree to the service agreement, and then click Activate to complete the purchase.

    4. After you purchase the Internet NAT gateway, return to the console and create an SNAT entry for the new gateway instance.

      Note

      Resource groups in the VPC can access the public internet only after you configure an SNAT entry.

      1. In the row of the new instance, click Management in the Operation column. On the instance details page, click the SNAT Management tab.

      2. On the SNAT Entry List tab, click Create SNAT Entry. Configure the following key parameters:

        Parameter

        Value

        SNAT entry granularity

        Select Specify VPC. This ensures that all resource groups in the VPC can access the public internet through the configured EIP.

        Select EIP

        Select the EIP that is bound to the current Internet NAT gateway instance.

      3. After you configure the parameters for the SNAT entry, click OK to create the SNAT entry.

      On the SNAT Entry List tab, wait for the Status of the new SNAT entry to become Enabled. Once the status is Available, the VPC bound to the resource group can access the public internet.

For more information about how to add and use a serverless resource group, see Use serverless resource groups.

3. Associate MaxCompute projects

Associate the created MaxCompute projects as compute resources with the DataWorks workspace so that you can process data in MaxCompute from Data Studio.

  1. Go to the DataWorks workspace list page. Switch the region to China (Shanghai) at the top, find the created workspace, and click the workspace name to enter the Workspace Details page.

  2. Click Computing Resources in the left-side navigation pane to automatically jump to the DataStudio > Compute Resources (image) page.

  3. Click Create Computing Resource, select the Compute Resource Type to associate, and then configure the parameters.

    This tutorial uses MaxCompute as the compute and storage resource, so select MaxCompute as the compute resource type and configure the related parameters. The following are the key parameters for this example. Leave other parameters at their default values.

    Parameter

    Description

    Data Source Name

    Custom name for the compute resource. Tasks reference this name to select the resource.

    Alibaba Cloud Account

    Set to Current Alibaba Cloud Account.

    Region

    Select China (Shanghai), the same region as the current DataWorks workspace.

    MaxCompute Project Name

    Select the MaxCompute project to associate. In this tutorial, associate the corresponding MaxCompute projects created in Step 2 for the production and development environments respectively.

    Default Access Identity

    Identity used to access the MaxCompute project from the current workspace.

    • Development environment: Currently, only access using the Executor identity is supported.

    • Production environment: Select from the drop-down list based on the currently logged-on account. This tutorial selects Alibaba Cloud primary account.

      Note

      If you are logged on with another identity, see New Data Studio: Associate a compute resource for the specific configuration.

    Connection Configuration

    Resource group used to connect to the MaxCompute compute resource. Only serverless resource groups associated with the current workspace are listed. Test connectivity for both the development and production environments.

  4. Click Create and Associate Computing Resource with DataStudio.

    As prompted, refresh the Data Studio compute resources page to verify the associated MaxCompute compute resource.

    Note

    If the created MaxCompute compute resource is in the Not Associated state, click the Associate button to associate it.

Next step

Your environment is ready. Next, synchronize basic user information and website access log data to MaxCompute. For more information, see Synchronize data.