When working on SAP Cloud Integration, it is a good practice to keep a backup of your integration flows and other artifacts outside the tenant. Git helps us do this in a simple way. Every time we make a change, we can save a version in a Git repository. If something goes wrong later, we can refer to an older version.
In this blog, I will explain how to connect SAP Cloud Integration with GitHub and use it to back up integration artifacts. This setup is mainly for storing design-time artifacts .
What We Need Before Starting
Before starting, make sure you have:
- Access to SAP Integration Suite with Cloud Integration enabled
- Permission to create or edit integration artifacts
- A GitHub account
- A GitHub repository
- A GitHub Personal Access Token
If you do not have a GitHub account, do not worry. The first few steps explain how to create one.
You can read my previous blogs here on SAP TMS , SAP ANS and HANA DB Integration with Cloud Integration.
Content Transport Using SAP Cloud Transport Management Service for SAP CI CF Environment
Setting Up Alerts for SAP Cloud Integration Using SAP Alert Notification Service
SAP HANA Cloud Activation on SAP BTP and Database Operations Using JDBC from Cloud Integration
Step 1: Create a GitHub Account
- Open GitHub.
- Click Sign up.
- Enter your email address, password, and username.
- Complete the email verification.
- Log in to GitHub.
For learning purposes, you can use your personal GitHub account. If you are working for a company, it is better to use a company GitHub organization and follow your company’s security guidelines.
Step 2: Create a Repository in GitHub
A repository is like a folder in GitHub where all backup files and their versions will be stored.
After logging in to GitHub, click the + icon in the top-right corner.
Select New repository.
Enter a repository name.
For example:
sap-cloud-integration-backupAdd a short description if required:
Repository for SAP Cloud Integration artifact backupSelect visibility Private. This is recommended because integration artifacts may contain technical details that should not be publicly visible.
Select Add a README file.
Click Create repository.
After the repository is created, copy the HTTPS repository URL. It will look similar to this:
https://github.com/NIKHILGURSAL/sap-cloud-integration-backup.git
Keep this URL ready. We will use it while configuring Git in SAP Cloud Integration in Step 4.
Step 3: Create a GitHub Personal Access Token
SAP Cloud Integration needs a secure way to connect to GitHub. GitHub does not allow normal account passwords for this purpose. Instead, we use a Personal Access Token.
Think of this token as a special password created only for SAP Cloud Integration.
- In GitHub, click your profile picture in the top-right corner.
- Select Settings.
- Scroll down in the left menu and select Developer settings.
- Select Personal access tokens.
- Select Fine-grained tokens.
- Click Generate new token.
Fill in the details as follows:
- Token name:
SAP Cloud Integration Backup - Expiration: Choose an expiry period based on your requirement. For learning, 90 days is fine.
- Resource owner: Select your GitHub account.
- Repository access: Choose Only select repositories.
- Select the repository created in the previous step.
Under Repository permissions, give the following permission:
Permission Access
| Contents | Read and write |
| Metadata | Read-only |
Click Generate token.
GitHub will now show the token. Copy it immediately and keep it in a safe place.
GitHub shows the token only once. If you close the page without copying it, you must create a new token. Do not share this token with anyone and do not add it to an integration flow, script, email, or document.
Step 4: Configure the Git Repository in Cloud Integration
- Go To Integration Suite->Settings->Integrations->GIT Access->Edit
2. Click Add and update GIT Repository HTTP URL from step 2 and Personal Access Token (PAT) from Step 3 and click on connect.
Repository name and details will be updated automatically and click add and save the changes.
Step 5: Choose the Integration Package to Back Up
- Go to Integration Suite -> Design->Integrations and API ->Select Package you want to backup
- If you do not have a package and iflow then create it.
Save the integration flow once it is created.
Step 6: Push the Artifact to GitHub
After the Git repository is configured and the integration artifact is saved, you can push it to GitHub.
Open the package or artifact that you want to back up ->Actions->Git Push
Update details of Token , Repository name and commit message and click push. You will get pop up of Artifact pushed.
Step 7: Check the Backup in GitHub
Let us confirm that the backup was successful.
Open GitHub.
Open your repository:
sap-cloud-integration-backupRefresh the page.
You should see files and folders created by SAP Cloud Integration.
Click Commits to see the version history.
You should find the commit message entered in the previous step
Step 8: Pull the artifact from GitHub
A. Import Iflow to different Tenant ( For Example Push performed in Dev and we need to Import (Pull) this in QAS Tenant )
In QAS tenant create package with same name as Dev and perform Git Import. Here I'm performing this in same Dev tenant hence getting error for iflow id.
B. Make some changes in GIT Repository artifact and then perform Git Pull.
I have modified groovy script in Git repository in resources for groovy script and performed Commit
Verify the commit
Now preform the Git pull to see the changes made and sync Cloud Integration with Git
You will see artifact pulled pop up.
Verify the changes in the iflow for groovy. Changes are visible in the iflow.
Conclusion
Using Git with SAP Cloud Integration is a simple and reliable way to maintain a history of integration artifacts. It gives us a backup outside the tenant and helps us understand changes over time.
By following this process regularly, you will always have a version history of your SAP Cloud Integration artifacts and a safer way to manage changes.
Reference
Regards,
Nikhil
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.