SAP API Management – Connecting on-prem made simple
Up until now connecting to your on-premise system from SAP HANA Cloud Platform, API management was a little complicated. Either you were using a “classic” Reverse Proxy / DMZ setup (with all it pros and cons) or you had to do a somewhat complicated workaround (https://blogs.sap.com/2016/03/15/sap-api-management-using-cloud-connector/).
Over the last few months we have already been testing another option in several customer projects. Since it was quite successful we also decided to release it as part of the product — and that’s what you can see now! When you log on to your API management portal (be it your productive instance or the one on HCP trial) you will see — in addition to some great UI enhancements — a new checkbox when creating an API Provider. This will now allow you to connect to your on-premise system.
But lets take a step back.
Obviously the first thing that you need to do is install and configure your cloud connector on-prem. This is explained already in several blogs (https://blogs.sap.com/2015/02/11/set-up-your-sap-web-ide-on-hana-cloud-part-2/ ) so I will only show the result in my configuration:
You can see that I have configured a Virtual Host MyOnPremSystem with port 500 which points to my on-prem system (which happens to run on the same machine, so): localhost:50001
With this configuration I can switch to my SAP HANA Cloud Platform Cockpit from where I can see under Connectivity – Cloud Connectors the successful connection to the on-prem system:
That’s all that you need (just remember [copy] the host name displayed here). Let’s go to the SAP API Management Portal and from the “Develop” (Pencil) icon on the left select “API Provider”. Next click on “Create” to create a new provider:
Now you enter the information (as you would have done previously), but make sure to check the box next to On-Premise.
In my case (since I am connecting to a SAP Gateway system), before you click on Save, click on the “Catalog Service Settings” and enter the information to the CatalogService, e.g. /sap/opu/odata/IWFND/CATALOGSERVICE/ServiceCollection. Under the Authentication Tab you might also want to fill in authentication details to connect to the Catalog service.
Now that’s it and you can click on Save.
To test the new connectivity, just create a new API Proxy:
From the drop-down select the API Provider you just created and click on Discover:
You should see a list of all the OData service from your on-premise SAP Gateway system. Just continue as you have before:
After saving the new API Proxy you are ready to test it!
And with these few steps you have now exposed your on-prem OData service via SAP HCP, API management to the internet!