Integrate Real-Time Access to Azure Data Lake Storage in SAPUI5 MVC Apps

Ready to get started?

Learn more or sign up for a free trial:

CData API Server

Use the built-in ODataModel class in SAPUI5 to create Web apps that reflect changes to Azure Data Lake Storage data in real time.

In this article we show how to use the CData API Server and with the ADO.NET Provider for Azure Data Lake Storage (or any of 200+ other ADO.NET Providers) to write SAPUI5 apps that leverage the capabilities of the Azure Data Lake Storage API, without writing to a back-end database. The API Server is a lightweight Web application that runs on your server and produces OData feeds of Azure Data Lake Storage data. OData is the standard for real-time data access over the Web and has built-in support in SAPUI5 and OpenUI5.

Set Up the API Server

Follow the steps below to begin producing secure Azure Data Lake Storage OData services:


The API Server runs on your own server. On Windows, you can deploy using the stand-alone server or IIS. On a Java servlet container, drop in the API Server WAR file. See the help documentation for more information and how-tos.

The API Server is also easy to deploy on Microsoft Azure, Amazon EC2, and Heroku.

Connect to Azure Data Lake Storage

After you deploy the API Server and the ADO.NET Provider for Azure Data Lake Storage, provide authentication values and other connection properties needed to connect to Azure Data Lake Storage by clicking Settings -> Connections and adding a new connection in the API Server administration console.

Authenticating to a Gen 1 DataLakeStore Account

Gen 1 uses OAuth 2.0 in Azure AD for authentication.

For this, an Active Directory web application is required. You can create one as follows:

  1. Sign in to your Azure Account through the .
  2. Select "Azure Active Directory".
  3. Select "App registrations".
  4. Select "New application registration".
  5. Provide a name and URL for the application. Select Web app for the type of application you want to create.
  6. Select "Required permissions" and change the required permissions for this app. At a minimum, "Azure Data Lake" and "Windows Azure Service Management API" are required.
  7. Select "Key" and generate a new key. Add a description, a duration, and take note of the generated key. You won't be able to see it again.

To authenticate against a Gen 1 DataLakeStore account, the following properties are required:

  • Schema: Set this to ADLSGen1.
  • Account: Set this to the name of the account.
  • OAuthClientId: Set this to the application Id of the app you created.
  • OAuthClientSecret: Set this to the key generated for the app you created.
  • TenantId: Set this to the tenant Id. See the property for more information on how to acquire this.
  • Directory: Set this to the path which will be used to store the replicated file. If not specified, the root directory will be used.

Authenticating to a Gen 2 DataLakeStore Account

To authenticate against a Gen 2 DataLakeStore account, the following properties are required:

  • Schema: Set this to ADLSGen2.
  • Account: Set this to the name of the account.
  • FileSystem: Set this to the file system which will be used for this account.
  • AccessKey: Set this to the access key which will be used to authenticate the calls to the API. See the property for more information on how to acquire this.
  • Directory: Set this to the path which will be used to store the replicated file. If not specified, the root directory will be used.

You can then choose the Azure Data Lake Storage entities you want to allow the API Server access to by clicking Settings -> Resources. This article uses Resources as an example.

Authorize API Server Users

After determining the OData services you want to produce, authorize users by clicking Settings -> Users. The API Server uses authtoken-based authentication and supports the major authentication schemes. You can authenticate as well as encrypt connections with SSL. Access can also be restricted by IP address; Access is restricted to only the local machine by default.

Create the View

In this article the user views and interacts with Azure Data Lake Storage data through an SAPUI5 table control. Table columns will be automatically detected from the metadata retrieved from the API Server's API endpoint. We define the following table in a separate View.view.xml file:

          path: 'meta>/dataServices/schema/[${namespace}===\'CData\']/entityType/[${name}===\'Resources\']/property',
          factory: '.columnFactory'
            <m:Title text="Azure Data Lake Storage Resources"></m:Title>
          <m:BusyIndicator class="sapUiMediumMargin"/>

Create the Model and Controller

In SAPUI5, you do not need to write any OData queries; an ODataModel instance handles the application's data access commands. The API Server then translates the queries into Azure Data Lake Storage API calls.

The controller processes user input and represents information to the user through a view. Define the controller in a new file, Controller.controller.js. Instantiate the model in the onInit function -- you will need to replace the placeholder values for the URL to the API Server, a user allowed to access the OData endpoint of the API Server, and the authtoken for the user.

], function(Controller, ODataModel, JSONModel, Column, Text ) {
  "use strict";

  return Controller.extend("sap.ui.table.sample.OData2.Controller", {
    onInit : function () {
      var oView = this.getView();
      var oDataModel = new ODataModel("http://myserver/api.rsc/",{user: "MyUser", password: "MyAuthToken"});
        oView.setModel(oDataModel.getMetaModel(), "meta");
      var oTable = oView.byId("table");
      var oBinding = oTable.getBinding("rows");
      var oBusyIndicator = oTable.getNoData();
        oTable.setNoData(null); //use default again ("no data" in case no data is available)
    onExit : function () {
    columnFactory : function(sId, oContext) {
      var oModel = this.getView().getModel();
      var sName = oContext.getProperty("name");
      var sType = oContext.getProperty("type");
      var iLen = oContext.getProperty("maxLength");
      iLen = iLen ? parseInt(iLen, 10) : 10;
      return new Column(sId, {
        sortProperty: sName, 
        filterProperty: sName,
        width: (iLen > 9 ? (iLen > 50 ? 15 : 10) : 5) + "rem",
        label: new sap.m.Label({text: "{/#Resources/" + sName + "/@name}"}),
        hAlign: sType && sType.indexOf("Decimal") >= 0 ? "End" : "Begin",
        template: new Text({text: {path: sName}})


Describe Application Logic

Create a component that contains the resources of your application. Define the following in Component.js:

], function(UIComponent) {
  "use strict";

  return UIComponent.extend("sap.ui.table.sample.OData2.Component", {
    metadata : {
      rootView : "sap.ui.table.sample.OData2.View",
      dependencies : {
        libs : [

      config : {
        sample : {
          stretch : true,
          files : [


Bootstrap OpenUI5 and Launch

To complete the MVC application, simply add the bootstrap and initialization code. Add these directly to index.html:


  <meta http-equiv="x-ua-compatible" content="ie=edge" />
  <meta charset="utf-8"> 
  <title>Azure Data Lake Storage Resources</title>
  <script id="sap-ui-bootstrap"
    data-sap-ui-resourceroots='{"sap.ui.table.sample.OData2": "./", "sap.ui.demo.mock": "mockdata"}'>
  <!-- application launch configuration -->
      sap.ui.getCore().attachInit(function() {
        new sap.m.App ({
          pages: [
                new sap.m.Page({
                    title: "Azure Data Lake Storage Resources", 
                    enableScrolling : false,
                  content: [ new sap.ui.core.ComponentContainer({
                  height : "100%", name : "sap.ui.table.sample.OData2"

  <!-- UI Content -->
<body class="sapUiBody" id="content" role="application">

The resulting SAPUI5 table control reflects any changes to a table in the remote Azure Data Lake Storage data. You can now browse and search current Azure Data Lake Storage data.