# Register Access Credentials (Cloud Storage)

{% hint style="info" %}
This section is only relevant if importing dataset files from a cloud storage provider. If you wish to upload dataset files from your local filesystem, proceed to the next guide, [Register a Data Family](https://markovml.gitbook.io/docs/guides/dataset-operations/register-dataset/register-a-data-family).
{% endhint %}

{% hint style="info" %}
Currently, MarkovML only supports importing datasets from AWS S3. Support for other cloud storage providers is on our roadmap.
{% endhint %}

With MarkovML, you can analyze your datasets stored in AWS S3. Just specify the S3 location for your dataset or for each segment if your dataset is segmented.\
\
If your dataset is hosted securely on S3, you must provide MarkovML with credentials to access your S3 bucket. You can register your S3 `ACCESS_KEY` and `ACCESS_SECRET` with MarkovML once and reuse the credentials to access other datasets in the future.

### Register Credentials Using Web UI

You can add new access credentials to register a dataset from the MarkovML web application as part of the workflow.\
\
Once logged in, navigate to the **Datasets** page. Click the "Add New Dataset" button at the top of the screen.

![Begin workflow to add a new dataset](https://3247973094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2vGu2QFqzSu6XdcGUFmu%2Fuploads%2Fgit-blob-ea1e60b53afe522168708cdde07572dbea741cfa%2Fadd%20dataset%20button.png?alt=media)

The option to "Import from cloud services" should be selected by default. Open the "Credentials" dropdown menu below, and you'll see an option to add a new credential.

![Add new set of access credentials](https://3247973094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2vGu2QFqzSu6XdcGUFmu%2Fuploads%2Fgit-blob-0baf35a710730d3234627c1a0475b2bde188b5b6%2Fadd%20new%20credentials.png?alt=media)

In the dialog to add new credentials, specify the cloud storage type and enter the required access information. You'll need to provide a unique name for the credential and may also give the credential a brief description if desired. Click the Save button when everything looks good.

![Fill in credential information](https://3247973094-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F2vGu2QFqzSu6XdcGUFmu%2Fuploads%2Fgit-blob-fd47ace583a80b78716ece5a6e8cae0c1c345c36%2Fnew%20credentials%20modal.png?alt=media)

Congratulations, your credentials have been securely stored with MarkovML! You can now proceed to [register a dataset](https://markovml.gitbook.io/docs/guides/dataset-operations/register-dataset/register-a-dataset) or [register a data family](https://markovml.gitbook.io/docs/guides/dataset-operations/register-dataset/register-a-data-family).

### Register Credentials Using Python Library

NOTE:  If you've already registered a credential using UI, you do not need to re-register the credential again from the SDK. You can retrieve any existing credential by name using  this.

```python
cred_response = CredentialManager.find_with_name('hatespeech')
```

The code example below illustrates registering an S3 credential with MarkovML using the Python SDK.&#x20;

```python
from markov.api.credentials.credential import S3Credentials, CredentialManager

s3_cred = S3Credentials(name='hatespeech',
                        details='Access credentials for the HateSpeech dataset',
                        access_key='<YOUR_S3_ACCESS_KEY>',
                        access_secret='<YOUR_S3_ACCESS_SECRET>')

cred_response = CredentialManager().register_s3_cred(s3_cred)
# check if the credential_id was successfully registered with Markov and handle it
if cred_response.is_ok():
   credential_id = cred_response.credential_id
else:
    raise f'Unable to register credentials. Error {cred_response.message}'
```

*Note:*  For security, we do not allow the retrieval of original cloud credentials through the SDK. You can use `credential_id` returned.

Now that we can securely access your cloud storage data let's create a data family.
