Business scenario / Requirements

It is required to transfer / upload / put a file (could be any file type e.g. binary, xml, txt, etc.) from SAP backend to Azure Storage (AzureBLOB container)

In order to make the example simple let’s assume

  • there is no need to map any data inside of the file / message (a pass through scenario / IFlow with FILE sender communication channel (CC) and REST receiver CC)
  • no message content manipulation / mapping will take place – therefore no ESR objects will be created
  • it is needed to keep the same file name

Azure Storage Authentication

Each client who makes requests against Azure Storage must be authorized. There are a few ways to authorize access including:

  • Shared Key (storage account key)
  • Shared Access Signature (SAS)

SAS access might be used to restricts clients (who are not trustworthy) from revealing / using storage account key and yet delegate access to specific storage resources. Not only that, this approach is easier to implement in SAP PO with use of standard REST adapter.

SAS is used to delegate access to a specific blob in the storage account for a specific time (e.g. till the end of next year) with a specified permissions (e.g. write only). SAS is nothing more than URI with specific query parameters including SAS token. SAS URI is all that it is needed to make SAP PI/PO to make a request against Azure BLOB Storage.

Read more about «Authorize requests to Azure Storage» – Link

Read more about «Delegate access with a shared access signature» – Link

Prerequisites

Azure admin has provided shared access signature URIs that looks following:

https://<account>.blob.core.windows.net/<path_to_custom_container>?
sp=<signedPermissions>&
st=<signedStart>&
se=<signedExpiry>&
spr=<signedProtocol>&
sv=<signedVersion>&
sr=<signedResource>&
sig=<signature>
SAS query parameterSAS NameDescriptionE.g.
spsignedPermissionsIndicates which operations a client who possesses the SAS may perform on the resource. Permissions may be combined.w – write
stsignedStartThe time at which the shared access signature becomes valid2021-01-21T11:12:13Z
sesignedExpiryThe time at which the shared access signature becomes invalid2031-01-21T11:12:13Z
sprsignedProtocolSpecifies the protocol permitted for a request made with the SAShttps,http
svsignedVersionIndicates the version of the service used to construct the signature field, and also specifies the service version that handles a request made with this shared access signature.2020-02-10
srsignedResourceSpecifies which blob resources are accessible via the shared access signature.c – container
sigsignatureThe signature is an HMAC computed over the string-to-sign and key using the SHA256 algorithm, and then encoded using Base64 encoding.kws%3D…
User Delegation SAS parameters

Read more about query string parameters: «Create a user delegation SAS» – Link

IFlow

CC FILE 
CC REST
Pass through IFlow

Sender FILE CC configuration

General Adapter-Specific Modules 
Source Processing Advanced 
File Access Parameters 
Source Directory: * 
File Name* 
Identfiers 
/mnt/SID/foIded 
Advanced Source File Selection 
Additional File(s)
Poll all the csv files from a specific folder
General Adapter-Specific Modules Identfiers 
Source Processing Advanced 
Adapter-Specfic Message Properties 
Z] Set Adapter-Specfic Message Properties 
Z] File Name 
Directory 
File Type 
Source File Size 
DSource File Timestamp 
Adapter Status 
Status: 
Advanced Mode
Use Adapter Specific Message Attribute (ASMA)
General Adapter-Specfic 
Processing Sequence 
Number 
Module Configuration 
Module Key 
Modules Identfiers 
Module Name 
AF_ModuIes/DynamicConfiguration8ean 
AF_ModuIes/DynamicConfiguration8ean 
Cal[SapAdapter 
Type 
Local Enterprise Bean 
Local Enterprise Bean 
Local Enterprise Bean 
Module Key 
DynWriteToParam 
DynReadFromParam 
Parameter Value 
read http://sap.com/xi/XI/System/REST File 
module.filename 
write http://sap.com/xi/XI/System/FiIe File 
module.filename 
Remove 
Move Up 
DynReadFromParam 
DynReadFromParam 
DynWriteToParam 
Parameter Name 
key. I 
value.l 
key. I 
value. I
Keep the file name to use it in receiver REST CC

Receiver REST CC

General Adapter-Specific Modules Identfiers 
General REST URL REST Operation Data Format Operation Rules Response Determination HITP Headers Error Handling 
Warning: Parameterizing HTTP Host or Port is a security risk (see SAP Note: 2174651) 
URL Pattern: * 
https://account.bIob.core.windows.net/container/{FiIeName}?sp=w&st=2C 
[3 Follow Server Redirects on HTTP GET calls 
Pattern Variable Replacement— 
Value Source: 
Pattern Element Name* 
Adapter Specfic Attribute* 
Attribute Name* 
Adapter Specfic Attribute 
FileName 
Custom Attribute
Shared access signature URI with pattern variable replacement for a dynamic file name
General Adapter-Specific Modules Identfiers 
General REST URL REST Operation Data Format Operation Rules Response Determination HITP Headers Error Handling 
HTTP Operation Source — 
Value Source: 
Static Value* 
Manual Value
Fixed PUT REST operation
General Adapter-Specific Modules Identfiers 
General REST URL REST Operation Data Format Operation Rules Response Determination HITP Headers Error Handling 
Request Format 
Data Format: 
Binary 
Binary request Content-Type header: text/csv 
Response Format (for Synchronous Messages) 
Data Format: 
Assign binary message 
Binary 
Main Payload of XI Message
Binary mode
General Adapter-Specific Modules Identfiers 
General REST URL REST Operation Data Format Operation Rules Response Determination HTTP Headers Error Handling 
Additional HTTP Headers 
Header Name 
x-ms blob-type 
Value Pattern 
810ck810b
Obligatory HTTP parameter: x-ms-blob-type = BlockBlob

Read more about HTTP parameters «Put Blob» – Link

NB! In order to avoid special characters contained in signature to be escaped set parameter EncodeURL = false

General Adapter-Specfic 
Processing Sequence 
Number 
Module Configuration 
Module Key 
Modules Identfiers 
Module Name 
sap.com/com.sap.aii.adapter.rest.app/RESTAdapter8ean 
Parameter Name 
EncodeURL 
Type 
Local Enterprise Bean 
Parameter Value 
false 
Module Key
Modules configuration for parameter EncodeURL = false

Message Monitoring

Error Scheduled Successful 
Terminated with error 
Sender Partner 
Sender Component 
Receiver Partner 
Receiver Component 
Interface 
dummy PutAzure810 
Interface Namespace 
dummyPutAzure 8 
Scenario Identifier
Successful message in Message Monitor
The File attribute to be used in receiver REST CC
8/17/2021 AM 
8/17/2021 AM 
8/17/2021 AM 
8/17/2021 AM 
8/17/2021 AM 
8/17/2021 AM 
8/17/2021 AM 
8/17/2021 AM 
8/17/2021 AM 
8/17/2021 AM 
Information 
Information 
Information 
Information 
Information 
Information 
Information 
Information 
Information 
Information 
Delivering to channel: CC_REST_Receiver_ 
MP: processing local module localejbs/sap.com'comsailaii.adapterrest_awRESTAdapterBean 
Set HTTP Header x-ms-blob-type to Block810b 
Preparing message content 
Calling server: PUT 
Server retumed code. 201 
REST call finished 
Message was successfully transmitted to endpoint using connection File http://sap.com,'xi/Xb'System 
Message status set to OLVO
A successful operation returns status code 201 (Created)

Related Post
Time to upgrade: SAP PI 7.5 Vs CPI

Time to upgrade: SAP PI 7.5 Vs CPI At the end of 2020, SAP will finish the support of all Read more

Categories:

No responses yet

Deja una respuesta

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

If you continue using this site, means that you accept the cookies. More info

We and our partners use cookies to give you the best online experience, including to personalise advertising and content. Data about your interaction with this site and the ads shown to you may be shared with companies involved in the delivery and/or personalisation of ads on this site and elsewhere online. Please let us know if you agree.

Cerrar