Technology Blogs by Members
Explore a vibrant mix of technical expertise, industry insights, and tech buzz in member blogs covering SAP products, technology, and events. Get in the mix!
cancel
Showing results for 
Search instead for 
Did you mean: 
WouterLemaire
Active Contributor

Introduction

As Tom Cenens already explained very well, we have not only Cloud Transport Management Service (cTMS) in BTP but also cTMS a part of SAP Cloud ALM: https://community.sap.com/t5/technology-blogs-by-members/integration-of-ctms-as-part-of-sap-cloud-al...

They are both identical, the only difference is the pricing. The one in ALM comes with free GB’s of bandwidth.

Now, if you haver BTP applications (Fiori apps, CAP apps, … ) developed in Business Application Studio (BAS) that needs to be transported from DEV to ACC and PRD later on, cTMS can be used. The cTMS used for this should be the same that’s being connected to CHARM so you can combine ABAP transports with BTP transports in the same change document. When Tom connects cTMS of ALM to CHARM, we need to connect CI/CD to that same cTMS of ALM. Unfortunately, just like the integration with CHARM, this is not document and most of the blog posts about this topic refer to cTMS on BTP.

(Transporting could also be done using CI/CD only using the GitFlow strategy but this does not connect BTP transports with ABAP transports like CHARM allows us to do. In the SAP world, we want to keep CHARM for transporting and integrate BTP transports into it.)

Cloud ALM API Instance

If not already done, create an ALM API instance in the ALM Sub Account as described here with the additional points of Tom:

https://help.sap.com/docs/cloud-alm/setup-administration/enabling-sap-cloud-alm-api

Once you have created the instance, also create service keys and copy them. You’ll need them in a later step.

Connect SAP CI/CD to ALM cTMS:

  • Copy the service keys from ALM API instance you have created in the previous step
  • Open the BTP CI/CD service
  • Go to the job of an app that you want to transport using cTMS of ALM

WouterLemaire_11-1711665168738.png

  • Switch to edit in the job and scroll down to the step “Cloud Transport Management”:

WouterLemaire_12-1711665191176.png

  • Open the valuehelp for the field “Service Key” and click on “Create Credentials”WouterLemaire_13-1711665212078.png
  • Paste the service keys of the ALM API instance

WouterLemaire_14-1711665234044.png

  • Remove the part of “endpoints”

WouterLemaire_15-1711665241536.png

WouterLemaire_16-1711665250853.png

  • As transport operation I use “Export from” and name of the DEV node. The export from will add it to the queue of ACC and not deploy it to DEV. The deployment to DEV will be done by the CI/CD service in my example.

WouterLemaire_17-1711665256786.png

  • Save and run your Job, the release step will be green and you’ll find the MTA in the queue of your ACC node in cTMS of ALM:

WouterLemaire_18-1711665262602.pngWouterLemaire_19-1711665273419.png

Connect any other CI/CD tool to ALM cTMS

Besides the SAP CI/CD service, some companies prefer to use the same CI/CD tooling they already have and use for other frameworks. There are already some examples on how to integrate your own CI/CD setup with cTMS but none of them cover cTMS on ALM. As a starting point I will use the setup described in this blog post:

https://community.sap.com/t5/technology-blogs-by-sap/integrate-a-ci-cd-pipeline-on-azure-devops-with...

The only thing we need to change for cTMS in ALM is the upload to cTMS step, line 70, 71 and 72:

WouterLemaire_20-1711665292725.png

I’ve changed it to the following: 

 

 

TOKEN=$(curl -s -X POST -u "<ALM Service Key uaa.clientid>:<ALM Service Key uaa.clientsecret>" -d "grant_type=client_credentials&response_type=token" <ALM Service Key uaa.url>/oauth/token | sed -n '/ *"access_token": *"/ {s///; s/{//g ;s/".*//; p; }')

BODY=$(curl -s --location --request POST '<ALM TMS Service Key uri>/v2/files/upload' --header "Authorization: Bearer $TOKEN" --form 'file=@"$(Pipeline.Workspace)/MySampleApp.mtar"' | awk -F ":" '{print $2}' | grep -Po "\\d+")

curl --location --request POST '<ALM TMS Service Key uri>/v2/nodes/export' --header 'Content-Type: application/json' --header "Authorization: Bearer $TOKEN"  --data-raw '{ "nodeName": "<Name of your ALM TMS DEV node>", "contentType": "MTA", "storageType": "FILE", "entries": [ { "uri": '"$BODY"' } ], "description": "<Description optional>", "namedUser": "<User name optional>" }'

 

 

ALM Service Key uaa.clientid: clientid property in the ALM service keys (eg.: sb-calm-api-inst-2!b..... )

ALM Service Key uaa.clientsecret: clientsecret property in the ALM service keys

ALM Service Key uaa.url: authentication url for ALM (eg.: https://<alm-instance-name>authentication.<region>.hana.ondemand.com/oauth/token )

ALM TMS Service Key uri: will become the url of ALM followed by the path to cTMS, something like this: https://eu20.alm.cloud.sap/api/imp-cdm-transport-management-api/v1 . In the end it will have a full uri that looks like this https://eu20.alm.cloud.sap/api/imp-cdm-transport-management-api/v1/v2/files/upload , strange to have /v1/v2 but it works!

Name of your ALM TMS DEV node: Name of ALM cTMS DEV node. You might have noticed that I’m using /export instead of upload. This is the same as the Transport Operation in the BTP CI/CD service “Export from”, it will upload it to the next node after DEV. Same reason as before, the deployment to DEV will be done by the CI/CD tool. 

Integrate other services with cTMS of ALM

Any other service that requires you to create a destination can be configured the same way. Take for example BTP BUILD WorkZone, std edition , transporting the content (catalogs, groups, roles, ... ) requires a destination “ctms_destination”. In this destination you need to provide the credentials to cTMS. Now in case of cTMS in ALM, you have to use clientid, client secret and uaa url from the ALM API service keys. The url of the destination should be the following: https://<region>.alm.cloud.sap/api/imp-cdm-transport-management-api/v1”  eg.: https://eu20.alm.cloud.sap/api/imp-cdm-transport-management-api/v1 or https://eu10.alm.cloud.sap/api/imp-cdm-transport-management-api/v1

 

WouterLemaire_22-1711665366884.png

Conclusion

In short, when switching to ALM, you need to use the service keys from the ALM API  service and the uri “https://eu20.alm.cloud.sap/api/imp-cdm-transport-management-api/v1” instead of this one from cTMS (standalone) “https://transport-service-app-backend.ts.cfapps.eu10.hana.ondemand.com”

Special thanks for investigating this with me to @TomCenens , @matthiaskiekens and @FrederikJ !

Labels in this area