- Building an OIC integration that moves files from SFTP to OCI Object Storage
Now, let's see the step by step process to establish this automation.
Configure OIC SFTP Server as a BIP Destination
1.1 Gather OIC SFTP Server Details
Obtain the
following connection details from your OIC SFTP server:
Required
OIC SFTP Details
- Host
or IP Address
- Port
- Username
- Private Key
- Open Command prompt on your machine (cmd)
- Execute below command to generate a SSH Private+Public Key Pair on your machine
ssh-keygen -t rsa -m PEM
- Navigate to the target folder and ensure the keys are generated
- Go to Settings -> File Server -> Settings
- Make sure your SFTP server status is Running
- Note down IP and Port
- Navigate to Users
- Identify the desired User and make sure it's enabled
- Open the User
- Upload the Public key (generated in previous step)
1.2 Upload the Private Key in BI Administration
- Login to Oracle Fusion environment
- Go to BI Analytics area by navigating to /analytics URL
- Navigate
to: BI Administration -> Manage Publisher
-> Upload Center
- Upload the
private key file obtained in the previous step.
1.3 Add the SFTP Server in BI Publisher Delivery
Settings
- Let's navigate
to: Delivery -> FTP
- Add a new
server entry using the OIC SFTP connection details.
- Enter the same username as configured in OIC File Server configuration
- Enter the Host and Port copied from OIC File Server configuration
- Select Private Key as Authentication Type and select the uploaded Key file from the dropdown
- Make sure to check 'Use Secure FTP' check-box
Click Test
Connection to verify, then Save.
Run BIP Reports with SFTP Destination in Fusion
Please note that no
modifications are required to existing Fusion BIP report definitions.
2.1 Submit the BIP Report
When submitting
a BIP report, set the Destination Type to the OIC SFTP server configured in
Step 1.
2.2 Monitor the ESS Job
Submitting the
report automatically triggers an ESS (Enterprise Scheduler Service) job that
runs the report and places the output file on the OIC SFTP server.
Configure OCI Object Storage User
Identify or
create a dedicated bucket user in OCI to write files to Object Storage.
- Navigate to Identity & Security
- Go to Domains -> User Management
- Create a dedicated user you wish to use to give access to the object storage
3.1 Set User Permissions
Ensure the user
has write permissions to the target bucket.
- Once the user is created, add it to a dedicated group so that we can apply the required policies on the same.
- Create a new policy and add below statement to grant the access to manage Object Storage
Allow group <group name> to manage objects in compartment <compartment_name> where any {request.permission='OBJECT_INSPECT', request.permission='OBJECT_READ', request.permission='OBJECT_CREATE'}
3.2 Gather OCI Credentials
Collect the
following details for the OCI user:
Required
OCI Credentials
- API
Key
- User
OCID
- Tenancy OCID
- Fingerprint
- Private Key
- Navigate to the newly created user
- Go to API Keys Section
- Click Add API Key
- Select "Generate API key pair" option
- Click Download Private Key (Optionally also download Public Key)
- Here, you will be presented with the Configuration file preview. Make sure to save this information as will need this in the next steps (to be used in OIC)
- We will obtain below information from above steps:
- User OCID
- Fingerprint
- Tenancy OCID
- Region
- Private Key file
Build the OIC Integration
4.1 Create an OIC SFTP Connection
- Create a new
SFTP connection in OIC using the details from Step 1.
- The details we will use include the SFTP server Host, Username and the Private Key file for that user.
4.2 Create an OCI Object Storage Connection
- Create a new
OCI Object Storage connection using the credentials gathered in Step 3.
- The details we will use include the Connection URL for the Object Storage, User OCID, Tenancy OCID, Fingerprint and the Private Key file.
4.3 Configure Integration Parameters
Now, let's build a simple integration to accept the following input parameters:
Integration
Input Parameters
- SFTP
File Path: This would be the source path on the OIC SFTP server
- SFTP
Archive File Path: This would be the destination path to move processed files
- File
Name Pattern: This would be the pattern to match files (e.g. *.csv)
- Namespace: OCI Object Storage namespace
- Bucket Name:
4.4 Integration Logic
The integration
performs the following actions in sequence:
- FTP Invoke:
This part will use the SFTP connection to retrieve files matching the given name pattern from the source path on the OIC SFTP server. - PUT to Object Storage:
This part will use the OCI Object Storage connection to copy the retrieved files to the specified bucket. - Archive:
This part will move the processed files to the archive folder on the OIC SFTP server.
Sample Run
5.1 Populate Integration Parameters
- Trigger the
integration with values appropriate for your use case:
5.2 Verify Successful Completion
- Confirm the
integration run completed successfully:
Verify Results
6.1 Target — OCI Object Storage
- Confirm the
output file has been copied to the specified OCI Object Storage bucket:
6.2 Source — OIC SFTP Archive
- Confirm the
source file has been moved to the archive folder on the OIC SFTP server: