All Products
Search
Document Center

Alibaba Cloud Model Studio:Use the Model Studio console to import data from OSS

Last Updated:Jan 14, 2025

You can import data from Object Storage Service (OSS) to Data Management of Alibaba Cloud Model Studio. This topic describes how to authorize OSS access and how to import data from OSS.

Note

You are billed for using OSS. For more information, see Get started by using the OSS console and Billing.

Authorize a service-linked role for OSS

Important

For this step, you must use an Alibaba Cloud account or an authorized RAM user. For information about how to manage or revoke a service-linked role, see Service-linked roles for Alibaba Cloud Model Studio.

Use an Alibaba Cloud account

  1. Log on to the Model Studio console. In the left-side navigation pane, choose Data Center > Data Management.

  2. On the Unstructured Data tab, click Import Data. Set Import Method to OSS.

  3. Click Authorize Now to authorize the service-linked role for OSS.

    image

  4. Click Confirm Authorization.

    image

    If a message similar to "Request failed. Try submitting again or contact the administrator. Error code: 10041495" appears, see FAQ.

Use a RAM user

When you are using a RAM user and click Confirm Authorization, an error message may appear, informing that You do not have the permissions to create a service-linked role, you must first grant the RAM user the permission to do so.

  1. Grant the RAM user the permission to create a service-linked role.

    1. Use your Alibaba Cloud account to log on to the RAM Console.

    2. In the left-side navigation pane, choose Permissions > Policies.

    3. Click Create Policy.

    4. On the JSON tab, enter the following details for Effect, Action, Resource, and Condition.

      {
          "Action": [
              "ram:CreateServiceLinkedRole"
          ],
          "Resource": "*",
          "Effect": "Allow",
          "Condition": {
              "StringEquals": {
                  "ram:ServiceName": "datahub.sfm.aliyuncs.com"
              }
          }
      }

      image

    5. Click OK.

    6. Name the policy and click OK.

      image

    7. In the left-side navigation pane, choose Identities > Users.

    8. Find the desired RAM user and click Add Permissions in the Actions column.

    9. Select the created policy from the list and click Grant permissions.

      The RAM user is now able to create a service-linked role.

      image

  2. Use the RAM user to authorize access to OSS.

    1. Use the RAM use to log on to the Model Studio console. From the left-side navigation pane, choose Data Center > Data Management.

    2. On the Unstructured Data tab, click Import Data. Set Import Method to OSS.

    3. Click Authorize Now to authorize the service-linked role for OSS.

      image

    4. Click Confirm Authorization

      image

      If a message similar to "Request failed. Try submitting again or contact the administrator. Error code: 10041495" appears, see FAQ.

Import data from OSS

  1. Log on to the OSS console.

  2. In the left-side navigation pane, choose Buckets.

  3. Add a specific tag to identify buckets that are accessible by Model Studio. Buckets without the tag is not accessible.

    1. In the Tags column of the desired bucket, hover over the image icon, then click Edit.

      image

    2. Click Create Tag.

      image

    3. Click + Tag and enter the following key and value:

      • Tag key: bailian-datahub-access

      • Tag value: read

    4. Click Save.

      image

  4. Next, log on to the Model Studio console. Then, in the left-side navigation pane, choose Data Center > Data Management.

  5. On the Unstructured Data tab, click Import Data. Set Import Method to OSS.

  6. Select the desired bucket, and then choose a folder or file.

    Model Studio cannot access files in the OSS root directory. Please use an existing subdirectory or create a new one.
    • Import Folder: Select folders to import. All files within the selected folders are imported, but files in the subfolders are not imported.

    • Import File: Select files within the current folder.

  7. Click Confirm. The import may take some time.

    For data imported from OSS, the Data Source will be Import from OSS.

    image

FAQ

When using the Alibaba Cloud account to authorize, click Confirm Authorization and a message similar to "Request failed. Try submitting again or contact the administrator. Error code: 10041495" appears

This error may occur because your Alibaba Cloud account has not activated OSS. To solve this:

  1. Go to the OSS Console, click Activate Now, and follow the prompts to activate OSS.

  2. Return to the Data Management page of Model Studio and try again.