Skip to content

Project to connect consumers like SAP Business Technology Platform apps/services via OData with Azure PaaS

License

Notifications You must be signed in to change notification settings

MartinPankraz/AzCosmosDB-OData-Shim

Repository files navigation

Azure PaaS OData Proxy

Open in GitHub Codespaces

Dotnet6 project to connect consumers like apps/services hosted on SAP Business Technology Platform via OData with Azure PaaS services through their native SDKs. This repos uses Azure CosmosDB and its NoSQL API SDK as well as provides foundation for Azure Blob Storage.

Apply the app to enable scenarios like below: for scalable global read-access to selected SAP data and SAP Private Link scenarios for SAP Cloud Application Programming Model (CAP).

  1. Geodes pattern for BTP apps powered by Azure CosmosDB. Learn more about the setup here and checkout the corresponding blog post
  2. OData proxy pattern with private connectivity for SAP CAP apps powered by Azure CosmosDB (serverless). Find the CAP app repos here.

Note - Learn more about private connectivity for SAP NodeJS apps powered by distributed Azure CosmosDB NoSQL here.

Note - the OData proxy is configured to be compatible with any Azure PaaS services. Foundation for Azure Blob storage is already present.

Getting Started 🛫

Prerequisites to replicate the blue print

Our implementation creates a fully functional solution. The approach is standardized, so that all components could be replaced as long as the runtime environment for the application stays .NET 6. To replicate our particular setup you will need:

  • Azure account with subscription and rights to deploy Azure CosmosDB and App Service in two regions
  • SAP on Azure with private VNet connectivity or routing from private VNet to SAP any-premise
  • SAP BTP account with Business Application Studio, Destination configured and Fiori Launchpad service to host an HTML5 app
  • (optional) Azure AD authorization to configure app registration and potentially give admin consent initially
  • (optional) Access to SE80 on SAP backend to upload Z-Programm for data extraction HTTP Post via ABAP.

Quickstart 🚀

Move appsettings.json template to root of GenericODataWebAPI and maintain according to your environment. The 'appsettings.json' is ignored by git, so you can safely maintain your secrets in the file.

cd GenericODataWebAPI
dotnet run

Note - From within GitHub Codespaces, click the URL shown (https://localhost:52055) on the console output to navigate to the exposed domain and port. It will be something like https://.preview.app.github.dev/health

Public interfaces are:

  • /health
  • /api/geode
  • /api/odata/$metadata

Protected interfaces are:

  • /api/odata/*

Consider tweaking the OData batch configuration on the Startup.cs depending on your requirements.

Config examples testing the OData API

Build upon provided queries to test with VS Code REST Client for convenience.

Fill the details you collected from your app registration on AAD on the environment and pay attention to the difference between client_id and scope. They use the same id but have different prefix and suffix. We didn't provide fixed values for the prefix, because they can be altered by you during creation on Azure.

pm-env

pm-collection

The Tests tab writes the env variable bearerToken, which is used for all calls in the collection, that require authentication.

Deploy to Azure🪂

This repos offers two flavours of deployment guidance supporting the associated blog posts with the goal in mind to reduce time to reproduce. Not every step is template driven yet.

  1. via template deployment, VS Code extension and some manual steps - more information is available here
  2. (coming soon) via Azure Developer CLI

What's next?

You can do a lot more once the app is deployed. Curious? We go you covered with some more information here

Final words

Feel free to reach out over GitHub Issues in case of any questions :-) Until then happy integrating and enjoy reading your SAP data globally.