You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
title: Import an SAP API using the Azure portal | Microsoft Docs
2
+
title: Import an SAP API by Using the Azure Portal | Microsoft Docs
3
3
titleSuffix:
4
4
description: Learn how to import OData metadata from SAP as an API to Azure API Management, either directly or by converting the metadata to an OpenAPI specification.
5
5
ms.service: azure-api-management
@@ -8,47 +8,52 @@ ms.custom:
8
8
author: martinpankraz
9
9
ms.author: mapankra
10
10
ms.topic: how-to
11
-
ms.date: 07/21/2023
11
+
ms.date: 03/31/2025
12
+
13
+
#customer intent: As an API developer, I want to import an SAP API to API Management.
This article shows how to import an OData service using its metadata description. In this article, [SAP Gateway Foundation](https://help.sap.com/viewer/product/SAP_GATEWAY)serves as an example.
20
+
This article describes how to import an OData service by using its metadata description. [SAP Gateway Foundation](https://help.sap.com/viewer/product/SAP_GATEWAY)is used as an example.
19
21
20
-
In this article, you'll:
22
+
In this article, you:
21
23
> [!div class="checklist"]
22
24
> * Retrieve OData metadata from your SAP service
23
-
> * Import OData metadata to API Management, either directly or after conversion to an OpenAPI specification
25
+
> * Import OData metadata to Azure API Management, either directly or after converting it to an OpenAPI specification
24
26
> * Complete API configuration
25
27
> * Test the API in the Azure portal
26
28
27
29
## Prerequisites
28
30
29
-
- An existing API Management instance. [Create one if you haven't already](get-started-create-service-instance.md).
30
-
- An SAP system and service exposed as OData v2 or v4.
31
-
- If your SAP backend uses a self-signed certificate (for test purposes), you may need to disable the verification of the trust chain for SSL. To do so, configure a [backend](backends.md) in your API Management instance:
31
+
- An API Management instance. If you don't have one, complete the steps in [Create an API Management instance by using the Azure portal](get-started-create-service-instance.md).
32
+
- An SAP system and service that's exposed as OData v2 or v4.
33
+
- If your SAP backend uses a self-signed certificate (for testing), you might need to disable the verification of the trust chain for SSL. To do so, configure a [backend](backends.md) in your API Management instance:
32
34
1. In the Azure portal, under **APIs**, select **Backends** > **+ Add**.
33
-
1. Add a **Custom URL**pointing to the SAP backend service.
34
-
1.Uncheck **Validate certificate chain** and **Validate certificate name**.
35
+
1. Add a **Custom URL**that points to the SAP backend service.
36
+
1.Clear the **Validate certificate chain** and **Validate certificate name** checkboxes.
35
37
36
38
> [!NOTE]
37
-
> For production scenarios, use proper certificates for end-to-end SSL verification.
39
+
> In production scenarios, use proper certificates for end-to-end SSL verification.
40
+
38
41
## Retrieve OData metadata from your SAP service
39
42
40
-
Retrieve metadata XML from your SAP service, using one of the following methods. If you plan to convert the metadata XML to an OpenAPI specification, save the file locally.
43
+
Use one of the following methods to retrieve metadata XML from your SAP service. If you plan to convert the metadata XML to an OpenAPI specification, save the file locally.
41
44
42
-
* Use the SAP Gateway Client (transaction `/IWFND/GW_CLIENT`), or
45
+
* Use the SAP Gateway Client (transaction `/IWFND/GW_CLIENT`).
46
+
or
43
47
* Make a direct HTTP call to retrieve the XML:
44
-
`http://<OData server URL>:<port>/<path>/$metadata`
45
-
48
+
`http://<OData server URL>:<port>/<path>/$metadata`.
Choose one of the following methods to import your API to API Management: import the metadata XML as an OData API directly, or convert the metadata XML to an OpenAPI specification.
54
+
Choose one of the following methods to import your API to API Management:
55
+
- Import the metadata XML as an OData API directly.
56
+
- Convert the metadata XML to an OpenAPI specification.
52
57
53
58
#### [OData metadata](#tab/odata)
54
59
@@ -60,89 +65,90 @@ Choose one of the following methods to import your API to API Management: import
60
65
61
66
1. Convert the OData XML to OpenAPI JSON format. Use an OASIS open-source tool for [OData v2](https://github.com/oasis-tcs/odata-openapi/tree/main/tools) or [OData v4](https://github.com/oasis-tcs/odata-openapi/tree/main/lib), depending on your metadata XML.
62
67
63
-
The following is an example command to convert OData v2 XML for the test service `epm_ref_apps_prod_man_srv`:
68
+
The following example converts OData v2 XML for the test service `epm_ref_apps_prod_man_srv`:
--scheme https --host <your IP address>:<your SSL port> \
68
73
./epm_ref_apps_prod_man_srv.xml
69
74
```
75
+
70
76
> [!NOTE]
71
-
> * For test purposes with a single XML file, you can use a [web-based converter](https://aka.ms/ODataOpenAPI) based on the open-source tool.
72
-
> * With the tool or the web-based converter, specifying the \<IP address>:\<port> of your SAP OData server is optional. Alternatively, add this information later in your generated OpenAPI specification or after importing to API Management.
77
+
> * For testing with a single XML file, you can use a [web-based converter](https://aka.ms/ODataOpenAPI)that's based on an open-source tool.
78
+
> * With the tool or the web-based converter, specifying the \<IP address>:\<port> of your SAP OData server is optional. Alternatively, add this information later in your generated OpenAPI specification or after you import the file to API Management.
73
79
74
80
1. Save the `openapi-spec.json` file locally for import to API Management.
75
81
76
-
## Import and publish backend API
82
+
## Import OpenAPI specification
77
83
78
-
1.From the side navigation menu, under the **APIs** section, select **APIs**.
79
-
1. Under **Create a new definition**, select **OpenAPI specification**.
84
+
1.In the left navigation pane, in the **APIs** section, select **APIs**.
85
+
1. Under **Create a new definition**, select **OpenAPI**:
:::image type="content" source="./media/import-api-from-oas/oas-api.png" alt-text="Screenshot that shows the OpenAPI tile.":::
82
88
83
-
1. Click **Select a file**, and select the `openapi-spec.json` file that you saved locally in a previous step.
89
+
1. Click **Select a file**, and then select the `openapi-spec.json` file that you saved locally in a previous step.
84
90
85
-
1. Enter API settings. You can set the values during creation or configure them later by going to the **Settings** tab.
86
-
*In **API URL suffix**, we recommend using the same URL path as in the original SAP service.
91
+
1. Enter API settings. You can set these values when you import the API or configure them later by going to the **Settings** tab.
92
+
*For the **API URL suffix**, we recommend using the same URL path as that of the original SAP service.
87
93
88
94
* For more information about API settings, see [Import and publish your first API](import-and-publish.md#import-and-publish-a-backend-api) tutorial.
89
95
90
96
1. Select **Create**.
91
97
92
98
> [!NOTE]
93
-
> The API import limitations are documented in [another article](api-management-api-import-restrictions.md).
99
+
> For information about API import limitations, see [API import restrictions and known issues](api-management-api-import-restrictions.md).
94
100
101
+
## Complete the API configuration
95
102
96
-
## Complete API configuration
97
-
98
-
[Add](add-api-manually.md#add-and-test-an-operation) the following three operations to the API that you imported.
103
+
[Add](add-api-manually.md#add-and-test-an-operation) the following three operations to the API that you imported:
99
104
100
105
-`GET /$metadata`
101
106
102
-
|Operation |Description |Further configuration for operation |
107
+
|Operation |Description |Additional configuration for the operation |
103
108
|---------|---------|---------|
104
109
|`GET /$metadata`| Enables API Management to reach the `$metadata` endpoint, which is required for client integration with the OData server.<br/><br/>This required operation isn't included in the OpenAPI specification that you generated and imported. | Add a `200 OK` response. |
:::image type="content" source="media/sap-api/get-metadata-operation.png" alt-text="Screenshot that shows the GET metadata operation.":::
107
112
108
113
-`HEAD /`
109
114
110
-
|Operation |Description |Further configuration for operation |
111
-
|---------|---------|---------|
112
-
|`HEAD /`| Enables the client to exchange Cross Site Request Forgery (CSRF) tokens with the SAP server, when required.<br/><br/>SAP also allows CSRF token exchange using the GET verb.<br/><br/> CSRF token exchange isn’t covered in this article. See an example API Management [policy snippet](https://github.com/Azure/api-management-policy-snippets/blob/master/examples/Get%20X-CSRF%20token%20from%20SAP%20gateway%20using%20send%20request.policy.xml)to broker token exchange. | N/A|
115
+
|Operation |Description |
116
+
|---------|---------|
117
+
|`HEAD /`| Enables the client to exchange cross-site request forgery (CSRF) tokens with the SAP server when required.<br/><br/>SAP also allows CSRF token exchange via the GET verb.<br/><br/> CSRF token exchange isn’t covered in this article. See an [example API Management policy snippet](https://github.com/Azure/api-management-policy-snippets/blob/master/examples/Get%20X-CSRF%20token%20from%20SAP%20gateway%20using%20send%20request.policy.xml) to broker token exchange. |
113
118
114
-
:::image type="content" source="media/sap-api/head-root-operation.png" alt-text="Operation to fetch tokens":::
119
+
:::image type="content" source="media/sap-api/head-root-operation.png" alt-text="Sceenshot that shows the operation for fetching tokens.":::
115
120
116
121
-`GET /`
117
122
118
-
Operation |Description |Further configuration for operation |
123
+
Operation |Description |Additional configuration for the operation |
119
124
|---------|---------|---------|
120
-
|`GET /`| Enables policy configuration at service root. | Configure the following inbound [rewrite-uri](rewrite-uri-policy.md) policy to append a trailing slash to requests that are forwarded to service root:<br/><br> `<rewrite-uri template="/" copy-unmatched-params="true" />` <br/><br/>This policy removes potential ambiguity of requests with or without trailing slashes, which are treated differently by some backends.|
125
+
|`GET /`| Enables policy configuration at the service root. | Configure the following inbound [rewrite-uri](rewrite-uri-policy.md) policy to append a trailing slash to requests that are forwarded to the service root:<br/><br> `<rewrite-uri template="/" copy-unmatched-params="true" />` <br/><br/>This policy removes potential ambiguity among requests with and without trailing slashes. These two types of requests are treated differently by some backends.|
121
126
122
-
:::image type="content" source="media/sap-api/get-root-operation.png" alt-text="Get operation for service root":::
127
+
:::image type="content" source="media/sap-api/get-root-operation.png" alt-text="Screenshot that shows the GET operation for the service root.":::
123
128
124
-
Also, configure authentication to your backend using an appropriate method for your environment. For examples, see [API Management authentication and authorization policies](api-management-policies.md#authentication-and-authorization).
129
+
You also need to configure authentication to your backend by using an appropriate method for your environment. For examples, see [API Management authentication and authorization policies](api-management-policies.md#authentication-and-authorization).
125
130
126
131
## Test your API
127
132
128
133
1. Navigate to your API Management instance.
129
-
1.From the side navigation menu, under the **APIs** section, select **APIs**.
134
+
1.In the left navigation pane, in the **APIs** section, select **APIs**.
130
135
1. Under **All APIs**, select your imported API.
131
136
1. Select the **Test** tab to access the test console.
132
-
1. Select an operation, enter any required values, and select **Send**.
137
+
1. Select an operation, enter any required values, and then select **Send**.
138
+
139
+
For example, test the `GET /$metadata` call to verify connectivity to the SAP backend.
133
140
134
-
For example, test the `GET /$metadata` call to verify connectivity to the SAP backend
135
141
1. View the response. To troubleshoot, [trace](api-management-howto-api-inspector.md) the call.
136
-
1. When testing is complete, exit the test console.
142
+
1. When you're done testing, exit the test console.
137
143
138
144
---
139
145
140
146
## Production considerations
141
147
142
-
* See an [example end-to-end scenario](https://community.powerplatform.com/blogs/post/?postid=c6a609ab-3556-ef11-a317-6045bda95bf0)to integrate API Management with an SAP gateway.
143
-
* Control access to an SAP backend using API Management policies. For example, if the API is imported as an OData API, use the [validate OData request](validate-odata-request-policy.md) policy. See also policy snippets for [SAP principal propagation for SAP ECC or S/4HANA](https://github.com/Azure/api-management-policy-snippets/blob/master/examples/Request%20OAuth2%20access%20token%20from%20SAP%20using%20AAD%20JWT%20token.xml) or [SAP SuccessFactors](https://github.com/Azure/api-management-policy-snippets/blob/master/examples/Request%20OAuth2%20access%20token%20from%20SuccessFactors%20using%20AAD%20JWT%20token.xml) and [fetching an X-CSRF token](https://github.com/Azure/api-management-policy-snippets/blob/master/examples/Get%20X-CSRF%20token%20from%20SAP%20gateway%20using%20send%20request.policy.xml).
144
-
* For guidance to deploy, manage, and migrate APIs at scale, see:
145
-
*[Automated API deployments with APIOps](/azure/architecture/example-scenario/devops/automated-api-deployments-apiops)
148
+
* See an [example end-to-end scenario](https://community.powerplatform.com/blogs/post/?postid=c6a609ab-3556-ef11-a317-6045bda95bf0)for integrating API Management with an SAP gateway.
149
+
* Control access to an SAP backend by using API Management policies. For example, if the API is imported as an OData API, use the [validate OData request](validate-odata-request-policy.md) policy. There are also policy snippets for [SAP principal propagation for SAP ECC or S/4HANA](https://github.com/Azure/api-management-policy-snippets/blob/master/examples/Request%20OAuth2%20access%20token%20from%20SAP%20using%20AAD%20JWT%20token.xml) or [SAP SuccessFactors](https://github.com/Azure/api-management-policy-snippets/blob/master/examples/Request%20OAuth2%20access%20token%20from%20SuccessFactors%20using%20AAD%20JWT%20token.xml) and [fetching an X-CSRF token](https://github.com/Azure/api-management-policy-snippets/blob/master/examples/Get%20X-CSRF%20token%20from%20SAP%20gateway%20using%20send%20request.policy.xml).
150
+
* For guidance on deploying, managing, and migrating APIs at scale, see:
151
+
*[Automated API deployments with APIOps](/azure/architecture/example-scenario/devops/automated-api-deployments-apiops).
146
152
*[CI/CD for API Management using Azure Resource Manager templates](devops-api-development-templates.md).
0 commit comments