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.
Authorize a service-linked role for OSS
Use an Alibaba Cloud account
Use a RAM user
Log on to the Model Studio console. In the left-side navigation pane, choose .
On the Unstructured Data tab, click Import Data. Set Import Method to OSS.
Click Authorize Now to authorize the service-linked role for OSS.

Click Confirm Authorization.

If a message similar to "Request failed. Try submitting again or contact the administrator. Error code: 10041495" appears, see FAQ.
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.
Grant the RAM user the permission to create a service-linked role.
Use your Alibaba Cloud account to log on to the RAM Console.
In the left-side navigation pane, choose .
Click Create Policy.
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"
}
}
}

Click OK.
Name the policy and click OK.

In the left-side navigation pane, choose .
Find the desired RAM user and click Add Permissions in the Actions column.
Select the created policy from the list and click Grant permissions.
The RAM user is now able to create a service-linked role.

Use the RAM user to authorize access to OSS.
Use the RAM use to log on to the Model Studio console. From the left-side navigation pane, choose .
On the Unstructured Data tab, click Import Data. Set Import Method to OSS.
Click Authorize Now to authorize the service-linked role for OSS.

Click Confirm Authorization

If a message similar to "Request failed. Try submitting again or contact the administrator. Error code: 10041495" appears, see FAQ.
Import data from OSS
Log on to the OSS console.
In the left-side navigation pane, choose Buckets.
Add a specific tag to identify buckets that are accessible by Model Studio. Buckets without the tag is not accessible.
In the Tags column of the desired bucket, hover over the
icon, then click Edit.

Click Create Tag.

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

Next, log on to the Model Studio console. Then, in the left-side navigation pane, choose .
On the Unstructured Data tab, click Import Data. Set Import Method to OSS.
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.
Click Confirm. The import may take some time.
For data imported from OSS, the Data Source will be Import from OSS.

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:
Go to the OSS Console, click Activate Now, and follow the prompts to activate OSS.
Return to the Data Management page of Model Studio and try again.