# SAP Cloud Integration

## Prepare SAP Cloud Integration

To allow the cloud service to be configured, the following prerequisite must be fulfilled.

1. Determine the tenant management node URL: The tenant management node url which is usually the URL when logged onto SAP CPI before the /itspaces. For example: https://<tmn>/itspaces would have a base URL of https://<tmn>;

2. An OAuth authentication service is required to be configured and activated. This is done following the SAP documentation and depends on whether you use the Neo or Cloud Foundry environments.

   For a Neo environment, the roles that need assigning when you get to the step related to the Security Authorizations section are:

   - IntegrationOperationServer.read

   - NodeManager.read

   - NodeManager.readsecuritycontent

     For Cloud Foundry the roles for the API service instance are:

   - MonitoringDataRead

   - SecurityMaterialDownload

## Prepare Avantra

### Create OAuth Credentials in Avantra

After you have configured the OAuth Authentication and received the credentials, you must now configure these credentials in Avantra. For this purpose, create new credentials under Integrations > Credentials.

Fill in the parameters as needed making sure you set the Credential Type parameter to `OAuth (Client Credentials)`.

### Create a SAP Cloud Integration Cloud Service in Avantra

The next step is to create a cloud service for SAP Cloud Integration. To do so, select Systems > Cloud Services and click New. The New Cloud Service dialog is displayed.

From the Service Type drop-down list, select SAP Cloud Integration and fill in the rest of the parameters. Click New to create the SAP Cloud Integration service.

Double-click the newly created service to open its Properties panel where you can set up a connection to the CPI hosted in the SAP Neo environment.

It is important to ensure that the correct `Cloud Environment` is selected and the `URL` is populated with the tenant management node URL. Without these two pieces of information, Avantra cannot communicate with the SAP Cloud Integration.

For Cloud Foundry it will look like this:

The 3 checks are implemented automatically once the service has been saved. These checks are:

- Message Logs: View details of all failed messages over a period of time where the statuses are ESCALATED or FAILED

- Keystore Certificate Expiration: View any certificates that are due to expire within the next 120 days

- Certificate to User Mapping Certificate Expiration: View any certificates that are due to expire within the next 120 days