# Connecting to Cloud Storage

In this article, we will see how a user can create a shared connection to access and store files from and to the cloud in Astera. To browse cloud files in a report model, the report model should be a part of a project containing the *Shared Action Connection*.

{% hint style="info" %}
**Note:** This feature of browsing files from the cloud only works if the user has the Cloud Connector add-on.
{% endhint %}

### Creating a New Cloud Connection

To create a new cloud connection in a project, you need to add a shared connection within the scope of that project. Once that is done, you can browse for cloud files from the *Report Options* panel in a report model that is present within the same project.

#### Adding a Shared Connection in a Project

1. To add a shared connection, we need to create a new project first. Here, we have named our project *RMCloud.cprj.*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FHD5o8aLM5wPAwB4kxZQy%2F01-project.png?alt=media\&token=d1ef9053-f1c3-4cf6-9b31-41bfb3377adb)

2. Next, create a folder, *Shared Connections,* inside the project. We will save our shared connections (*.sact* files) in this folder.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FUJj9BKBB4KeXyvUeBIjU%2F02-folder.png?alt=media\&token=c0ff6b7d-4025-44f4-b52d-f9e9dc7a0e3f)

3. Right-click on the folder, and select *Add New Item…*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FHK8aWqULxLuCni1DCpcU%2F03-add-new-item.png?alt=media\&token=9920875a-7cd7-4f7b-9dc8-0a9c1442ebf3)

4. Select *SharedAction* from the list of file types, give it a meaningful name, and click *Add.*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F1stcOxz4YPMU6cVC0N3F%2F04-shared-action.png?alt=media\&token=f955e20b-37b4-48fb-9c80-99405ea12f42)

5. A *.sact* file will open. We have saved it with the name *SharedAction.sact*.

Go to *Toolbox > Resources* and drag-and-drop the *Cloud Storage Connection* object onto the designer.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FhuRuspFQ35K2pNOvPhi9%2F05-cloud-storage-connection.png?alt=media\&token=48192764-6f24-48df-b119-25f14cab659d)

6. Right-click on the header of the object and select *Properties.*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FX426saM6sJaIVOG38qLm%2F06-properties.png?alt=media\&token=2c9a89fb-44fa-4e06-9866-537d79ebc5ef)

7. A *Cloud Connection Properties* window will open, where you can configure your *Cloud Connection* object by providing appropriate credentials. Select the *Provider* from the drop-down menu. In this case, we will select *Amazon S3.*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FHJTY0wHBWYW8a12qAd6M%2F08-provider.png?alt=media\&token=0b6f8fb1-ef57-43e2-944a-ba7391164885)

8. Provide appropriate credentials, *Access Key ID* and *Access Key.* Click *OK.*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FfSQ2cozkFdzvKkZzgVef%2F09-credentials.png?alt=media\&token=9c291a8c-8d35-463c-8fe9-d86b7b55c3c4)

Your *SharedAction.sact* is now configured. You can access files from this cloud connection in the project.

#### Adding a Shared Connection via Report Options

1. To create a new cloud connection through *Report Options,* we need to create/add a report model within our project first.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FyoD21b7DN8paHdsT8V7O%2F10-report-model.png?alt=media\&token=1a11cc7b-0cf5-45be-a5f4-fe33877347b2)

2. Open the report model. Go to the *Report Options* panel, and click on the arrow next to the folder icon in the *Data File Location* group-box. Select the *Browse Cloud Files* option.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FxZamCTcFX8QNxtEBTsb0%2F11-browse-cloud-files.png?alt=media\&token=102d8bd9-a332-4d6d-8008-b4f1b66e966f)

3. A *Browse Files* window will open. We can see the Amazon S3 *SharedAction* connection we created above in this window.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FTXRXr9gWNuIJFRsn0xtk%2F12-browse-files.png?alt=media\&token=03fb672b-4f24-4456-8c22-e0680cce4083)

4. Click on the *Add New Connection* icon.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FVEOFDhH4SQK7hr97031C%2F13-add-new-connection.png?alt=media\&token=f1fed0d6-04c6-48de-8104-a7aadfd1b8a0)

{% hint style="info" %}
**Note**: This is an alternative way for you to add a shared action (shared cloud connection) to the project you are working in. If you have already created a shared action for the cloud connection you want to use in your project, there is no need to add a new connection.
{% endhint %}

5. A window to *Add a Cloud Connection* will open.

Here, we will select *Microsoft Azure Blob Storage* as our *Provider*.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Fq4mVMHQvJWuQpHOo91oo%2F15-add-azure.PNG?alt=media\&token=7598aeed-a854-4696-8b42-ba446c64c114)

6. There are two ways to authenticate the connection, using an *Access Key* or through *Shared Access Signature.* For now, we will use the *Access Key.*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FLSqrETGd8MAMpI2XjLam%2F16-access-key.png?alt=media\&token=78ef204a-5610-46b6-8004-014c5d3ba488)

7. Provide relevant credentials by specifying the *Storage Account Name* and *Access Key.* Click *OK.*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FXuWLuhawsBsVDf5LDar5%2F17-authentication.png?alt=media\&token=d774ceed-7052-4018-9a02-596cbeda1a23)

8. The newly created connection is now a part of the project.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FqnYich4JSWsFaihkUqxU%2F18-connection.png?alt=media\&token=b6e26fe0-f45b-4a0e-9b7e-5bc2cea35416)

9. Select the file you want to extract data from from the cloud connection and click *Open*.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FWImVvOqgaIycpqbTgQv1%2F41-cloud-file.png?alt=media\&token=e4d96676-80a2-472f-888a-38d516774745)

10. Create a data region and relevant fields in the report model to extract relevant data from the source file.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FMET1df9y4y5QMBV0WGC2%2Freport-browser.png?alt=media\&token=2b9a40de-a007-4456-88df-c9c779b6ffa2)

11. Click on *Preview Data* to see if the report model is extracting data from the specified fields correctly.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FCPoXOifOUcCg5uXDeyHO%2F42-preview-output.png?alt=media\&token=91b08d3b-3e83-4ea2-8cdd-82083e767c0a)

12. The *Data Preview* window shows the data extracted from the file located on the cloud.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F16yeLS9AeLdETeHiJb3D%2F43-data-preview.PNG?alt=media\&token=515767e3-975d-40c0-943e-b169f91684b7)

### Exporting Data to a Cloud Destination

Here is how we can export our extracted data to an [Excel ](https://documentation.astera.com/astera-data-stack-v10/dataflows/destinations/excel-workbook-destination)or a [Delimited ](https://documentation.astera.com/astera-data-stack-v10/dataflows/destinations/delimited-file-destination)file and save it on the cloud destination.

1. Go to *Report Browser > Data Export Settings* and select *Create New Export Setting and Run (to Excel)* option.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F9Lt3cuocyfnfBr41HJnK%2F19-export-to-excel.png?alt=media\&token=b3da311f-751d-4db9-a5c6-8add4c251d58)

2. A configuration window will open. Click on the arrow next to the folder icon and select *Browse Cloud Files* option.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FYRXjRB3TPCvjvL3GpNj1%2F20-browse-cloud.png?alt=media\&token=4b0d5fba-e382-43e7-a559-9e2f05b51b5d)

3. Locate the cloud directory where you want to save the Excel file, give it a meaningful name, and click *Open.*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FzajPrdPVRx3GsEiJk9Ko%2F21-save-excel.png?alt=media\&token=adc90def-7940-4504-9dee-a8f2c603d71d)

4. The file path is now pointing towards the Amazon S3 cloud provider. Click *OK.*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Fws6ejpALzETWmT5b1MrM%2F22-click-ok.png?alt=media\&token=69470e1a-4245-4a39-8705-3953bdecddb5)

5. The *Job Progress* window shows the job status and the cloud path where the destination file has been created.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FBAjgM91ll53xoovGqzot%2F23-2-dest.png?alt=media\&token=17a70d61-ba16-4ba2-89b5-81226f0465d8)

6. If you want to create a *Delimited File Destination*, click on this icon in the *Data Export Settings* window and follow the same steps (step 2 onwards) as mentioned above.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FFa9v8PHLxc0u2mpDBJHa%2F24-create-delimited.png?alt=media\&token=2eb725b5-c8ae-423d-90a9-ae6d64eba391)

### Using Files from the Cloud in a Dataflow

We can access files from the cloud in a dataflow using the *Report Source* object. For that, the dataflow must be a part of the project or must contain a *Cloud Storage Connection* object pointing to the cloud location.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FdXR3dZXAuByckLVlaB3i%2F25-dataflow.png?alt=media\&token=fc4a4544-0ef8-46ba-8d1d-acc900b5b68c)

In this case, we will extract data from a file saved on a cloud location using a report model from the local directory.

1. Go to *Toolbox > Sources* and drag-and-drop the *Report Source* object onto the designer.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Fhnx2FkPvEfI5lI41SAip%2F26-report-source.png?alt=media\&token=b2f4ade3-ee79-411d-90a8-6cbf3d4738b0)

2. Right-click on top of the *Report Model* object header and select *Properties* from the menu.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FcftywUbhUlugMbG1RErD%2F27-report-properties.png?alt=media\&token=a64589c7-7dd7-462f-9de8-a673337a8cf4)

3. Click on the arrow button next to the folder icon in the *Report Location* group-box to browse files from the cloud.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FqwHQ85AnFsuykBhemJji%2F28-browse-cloud.png?alt=media\&token=82f8a0d4-f95a-4256-ab6b-9584f623f1a5)

4. Locate the file in cloud directory and click *OK.*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Ff9VWFC0y6WsDi0ycktDX%2F29-locate-file.png?alt=media\&token=9d995a2d-4a55-491c-b82d-f0fb8ec7516c)

5. The *File Path* is now pointing towards the Amazon S3 cloud provider. Click on the folder icon to browse the report model from your local directory.

{% hint style="info" %}
**Note**: The report model must be a part of your project.
{% endhint %}

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Fl1rSXTzkOdMpaJSRLXv8%2F30-folder.png?alt=media\&token=936ff76c-3143-4533-8454-6c7e8895173c)

6. Click *OK* to close the window.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FWHUetbQTI5owMBbMAI1G%2F31-ok.png?alt=media\&token=a104efcb-4b1c-44b4-b413-e8800660c309)

7. The *Report Source* object is now configured with a file path coming in from the Amazon S3 cloud connection and the report model from the local directory.

Right-click on the header and select *Preview Output.*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FwCGjCTuBJZ3YFm2pjYfh%2F32-preview.png?alt=media\&token=b2f69c76-7ed0-49da-941f-e32e4deedfce)

8. The *Data Preview* window shows that the file is correctly being read by the report model.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FUpNYW0PXWwVhagPjq40z%2F33-data-preview.PNG?alt=media\&token=45077e2b-1811-469e-8d52-93b9b48cc8fe)

### Using Files from the Cloud in a Workflow

We can access files from the cloud in a workflow as well, using the *File System* object. For that, the workflow must be a part of the same project as your shared connection.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FEmvOsuinK8WzOkvm62OP%2F34-workflow.png?alt=media\&token=e26cd964-95af-4bf8-8b85-9cf15cde263e)

#### Use-Case

In this case, we want to read all the files from a particular cloud directory (in a workflow) and extract data from those files to write it in an [*Excel Workbook Destination* ](https://documentation.astera.com/astera-data-stack-v10/dataflows/destinations/excel-workbook-destination)(in a dataflow).

We will do this by using the [*Report Source as a Transformation* ](https://documentation.astera.com/astera-data-stack-v10/dataflows/transformations/sources-as-transformations#report-source-as-a-transformation)in a [dataflow ](https://documentation.astera.com/astera-data-stack-v10/use-cases/end-to-end-use-cases/data-extraction/reusing-the-extraction-template-for-similar-layout-files)where we can [parametrize](https://documentation.astera.com/astera-data-stack-v10/use-cases/end-to-end-use-cases/data-extraction/reusing-the-extraction-template-for-similar-layout-files#parameterizing-the-dataflow) the path of the file we want to extract data from using the *Variables* object. This is what the dataflow will look like:

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FDbzAU4ixNKWmVhKk6AZu%2F01-dataflow.PNG?alt=media\&token=e39722ed-66a5-4f58-b17b-6fe1b630a30c)

Then, we will call the dataflow in a [workflow ](https://documentation.astera.com/astera-data-stack-v10/use-cases/end-to-end-use-cases/data-extraction/reusing-the-extraction-template-for-similar-layout-files#designing-a-workflow)using a *Run Dataflow* object and read the files from the cloud using a *File System Items Source* in a loop. We will send the cloud file path of the source file to the *File Path* variable in the dataflow as shown below.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2F8VgXav7Rk4TeOUADE346%2F02-workflow.PNG?alt=media\&token=8a3599b8-10be-43df-903d-51c4cdcad4f2)

#### Using File System Items Source to Browse Cloud Files

1. Go to *Toolbox > Sources* and drag-and-drop the *File System Items Source* object onto the designer.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FiN6USwBoYUuDiy0eaSfQ%2F03-source.png?alt=media\&token=26f190c6-143c-496c-bbe3-dbab56d82a90)

2. Right-click on the object header and select *Properties.*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FVXg5gMfauREV7E5u0BL6%2F04-properties.png?alt=media\&token=9e824a7d-d93d-4a45-b292-84689954dd4e)

3. Click on *Browse Cloud Folders* to access the cloud folder from where you want to read files.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FpbXzQdlcn75X8OTJvqxy%2F05-browse-cloud.png?alt=media\&token=116f44bd-7935-4f68-8744-54dcffa6e71f)

4. Here, we have selected the folder containing the source files from our Amazon S3 cloud connection. Click *Open.*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FpEIuBl6znhWqKdpe3qmD%2F06-cloud-folder.png?alt=media\&token=41bda1c1-cbf0-4aa9-8dd4-d09f9f94e3fc)

5. Our *File Path* is now pointing towards a cloud file path. Click *OK.*

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FXN4Cjys0lj0coZOQjf6B%2F07-click-ok.png?alt=media\&token=a9e557b3-0f7b-4049-b188-074f7b542552)

6. Our workflow is now complete. Click on *Start Workflow* to run the workflow.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2FbjGWtYQ958hKqHZ351lO%2F08-start-workflow.png?alt=media\&token=c216b2f0-ebd6-4661-a91d-b411b8f0977d)

7. The *Job Progress* window shows the status of the job and the path of the Excel destination.

![](https://3083465318-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FsR50Wa7EwZGlmPSAMkkf%2Fuploads%2Fgitf8pSQ1huIrTTgMeHm%2F09-job-progress.png?alt=media\&token=1354ede6-86e8-4131-bd8d-9a2cff769a0a)

This is how you can create cloud connections and browse files from the cloud in Astera.
