Technology Blog Posts by Members
cancel
Showing results for 
Search instead for 
Did you mean: 
koichiro_ogawa01
Participant
2,726

In this blog, I'll introduce how to consume Azure Blob API via SAP Integration Suite.

This picture is what I explain in this blog.

koichiro_ogawa01_0-1718891083584.png

 

Prerequisite

  1. You have Azure account
  2. You have created Blob storage account
  3. You have BTP Trial Account
  4. Subscribe Integration Suite

Regarding 3 & 4, you can refer this tutorial, Connectivity to Non-SAP Applications using SAP Integration Suite .

 

API Details

Before send HTTP request, in general we have to confirm the information of HTTP method(Get/Post/Put, etc) and query parameters.

But on this page, we cannot find them.

So this time, I refer to API Docs of Open connecter, which I'm not sure that it matches with Azure Adapter.

Integration Suite > Capability > Extend Non-SAP Connectivity > Connector > Azure Blob

koichiro_ogawa01_1-1718887900477.png

See API Docs > files Create a file.

koichiro_ogawa01_2-1718888117555.png

We can now confirm we need following parameters.

Parameter Name 
Authorizationheader
containerNamequery 
pathquery 
filebody

 

Create Security material

There're several ways to authorize Azure resources.

For more information, please refer to the following link.

Authorize requests to Azure Storage 

In this article, I explain the way to use "Shared Key". 

But please note that Shared key authorization is not recommended.

Put Block List 

Go to Monitor > Integrations and APIs > Manage Security > Security material.

Create secure parameter as instructed in this SAP note (3331283).

koichiro_ogawa01_14-1718890450857.png

 

Activate Azure Adapter for SAP Integration Suite

Regarding the connection between Azure Blob Storage and SAP Integration Suite, we can use predefined package.

In this article, I use the following adapter.

SAP Accelerator Hub > Azure Storage Adapter 

In this article, I'll use "Azure Blob Storage, Upload Block Blob into the Container"

koichiro_ogawa01_0-1718869228638.png

Integration Suite Home Screen > Discover Integrations > Search "Azure Adapter for SAP Integration Suite"

koichiro_ogawa01_1-1718870262968.png

Press "Copy"

koichiro_ogawa01_2-1718870406049.png

 

You can confirm the adapter was activated in Design > Integration and APIs

koichiro_ogawa01_16-1718890742742.png

 

Create Integration Flow

Choose Design > Integrations and APIs > Create to create an integration package.

Choose the Artifacts tab. Here you will create your first integration flow. Choose Add > Integration Flow.

Choose Edit to start editing the integration flow.

 

Runtime Configuration

First, you have to set up query parameters that you send from API client.

Integration Flow > Runtime Configuration.

Allow query parameters that the API requires.

koichiro_ogawa01_0-1718886943841.png

 

HTTPS

Connect "Sender" and "Start" by HTTPS as follows.

koichiro_ogawa01_4-1718871026467.png

koichiro_ogawa01_5-1718871085838.png

AddessYou can set API path as you like.
CSRF Protectedoff

 

Azure Storage

Connect end and Receiver by "Azure Storage Adapter" as follows.

koichiro_ogawa01_6-1718872150257.png

On Connection Tab, Select shared key that you created previous step.

koichiro_ogawa01_8-1718872215132.png

On Processing Tab, set parameter's as follows.

koichiro_ogawa01_4-1718888877460.png

ParameterValue
OperationUpload Block Blob
Storage Account NameYour Azure Blob storage account.
Container Name${header.containername}
Blob Path${header.path}

 

Deploy

The entire process is as follows.

If everything is OK, press "deploy"

koichiro_ogawa01_5-1718889098126.png

Confirm that the endpoint URL is generated by following path, Monitor > Integration and API's > Manage Integration Content.

koichiro_ogawa01_15-1718890635073.png

 

Test by Postman

Open your Postman application.

Paste the copied endpoint in the request URL field and choose POST as the method.

Go to your SAP BTP subaccount. Copy the clientid and clientsecret from your service key.

koichiro_ogawa01_7-1718889568695.png

koichiro_ogawa01_8-1718889592940.png

For Authorization, choose Basic Auth. Paste the clientid and clientsecret as the username and password.

koichiro_ogawa01_9-1718889734625.png

For Params, you can enter query parameters, "containerName" and "path" as follows.

koichiro_ogawa01_10-1718889812985.png

For Body, upload a file from your local.

koichiro_ogawa01_11-1718889985147.png

Click "Send" and confirm status code 200 is returned.

koichiro_ogawa01_12-1718890070689.png

You can confirm the file is transferred to Azure Storage Container.

koichiro_ogawa01_13-1718890125354.png

 

 

 

Reference

CPI: use Query parameters in external API call 

Open Connectors - Query Parameters....using HTTP connectors 

Steps to access Azure Blob Storage via REST API from SAP CPI using Azure Storage Adapter and SAP PO/... 

Connectivity to Non-SAP Applications using SAP Integration Suite