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
Copy file name to clipboardExpand all lines: articles/api-management/sap-api.md
+27-23Lines changed: 27 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
title: Import an SAP API by Using the Azure portal | Microsoft Docs
2
+
title: Import SAP OData Metadata as an API
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,7 +8,7 @@ ms.custom:
8
8
author: martinpankraz
9
9
ms.author: mapankra
10
10
ms.topic: how-to
11
-
ms.date: 03/31/2025
11
+
ms.date: 03/16/2026
12
12
13
13
#customer intent: As an API developer, I want to import an SAP API to API Management.
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.
20
+
This article describes how to import an OData (Open Data Protocol) service into Azure API Management by using OData metadata. The following example uses [SAP Gateway Foundation](https://help.sap.com/docs/SAP_GATEWAY).
21
21
22
-
In this article, you:
22
+
In this article, you learn how to:
23
23
> [!div class="checklist"]
24
24
> * Retrieve OData metadata from your SAP service
25
25
> * Import OData metadata to Azure API Management, either directly or after converting it to an OpenAPI specification
@@ -28,12 +28,12 @@ In this article, you:
28
28
29
29
## Prerequisites
30
30
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).
31
+
- Create an [API Management instance](get-started-create-service-instance.md).
32
32
- An SAP system and service that's exposed as OData v2 or v4.
33
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:
34
-
1. In the Azure portal, under **APIs**, select **Backends** > **+ Add**.
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.
34
+
1. In the Azure portal, under **APIs**, select **Backends** > **+ Create new backend**.
35
+
1. Add a **Custom URL** that points to the SAP backend service.
36
+
1.Expand the **Advanced** section, then clear the **Validate certificate chain** and **Validate certificate name** checkboxes.
37
37
38
38
> [!NOTE]
39
39
> In production scenarios, use proper certificates for end-to-end SSL verification.
@@ -42,10 +42,8 @@ In this article, you:
42
42
43
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.
44
44
45
-
* Use the SAP Gateway Client (transaction `/IWFND/GW_CLIENT`).
46
-
or
47
-
* Make a direct HTTP call to retrieve the XML:
48
-
`http://<OData server URL>:<port>/<path>/$metadata`.
45
+
* Use the SAP Gateway Client (transaction `/IWFND/GW_CLIENT`).
46
+
* Make a direct HTTP call to retrieve the XML: `http://<OData server URL>:<port>/<path>/$metadata`.
@@ -63,7 +61,7 @@ Choose one of the following methods to import your API to API Management:
63
61
64
62
## Convert OData metadata to OpenAPI JSON
65
63
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.
64
+
1. 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.
67
65
68
66
The following example converts OData v2 XML for the test service `epm_ref_apps_prod_man_srv`:
69
67
@@ -77,16 +75,17 @@ Choose one of the following methods to import your API to API Management:
77
75
> * 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
76
> * 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.
79
77
80
-
1. Save the `openapi-spec.json` file locally for import to API Management.
78
+
1. Save the *openapi-spec.json* file locally for import to API Management.
81
79
82
80
## Import OpenAPI specification
83
81
84
-
1. In the left navigation pane, in the **APIs** section, select **APIs**.
85
-
1. Under **Create a new definition**, select **OpenAPI**:
82
+
1. In the sidebar menu, in the **APIs** section, select **APIs**.
83
+
84
+
1. Under **Create from definition**, select the **OpenAPI** tile:
86
85
87
86
:::image type="content" source="./media/import-api-from-oas/oas-api.png" alt-text="Screenshot that shows the OpenAPI tile.":::
88
87
89
-
1.Click**Select a file**, and then select the `openapi-spec.json` file that you saved locally in a previous step.
88
+
1.Choose**Select a file**, and then select the *openapi-spec.json* file that you saved locally in a previous step.
90
89
91
90
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
91
* For the **API URL suffix**, we recommend using the same URL path as that of the original SAP service.
@@ -100,7 +99,7 @@ Choose one of the following methods to import your API to API Management:
100
99
101
100
## Complete the API configuration
102
101
103
-
[Add](add-api-manually.md#add-and-test-an-operation) the following three operations to the API that you imported:
102
+
Add the following three operations to the API that you imported. To learn how, see [Add and test an operation](add-api-manually.md#add-and-test-an-operation).
104
103
105
104
-`GET /$metadata`
106
105
@@ -122,23 +121,28 @@ Choose one of the following methods to import your API to API Management:
122
121
123
122
Operation |Description |Additional configuration for the operation |
124
123
|---------|---------|---------|
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.|
124
+
|`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.|
126
125
127
126
:::image type="content" source="media/sap-api/get-root-operation.png" alt-text="Screenshot that shows the GET operation for the service root.":::
128
127
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).
128
+
You also need to configure authentication to your backend by using an appropriate method for your environment. For examples, see [Authentication and authorization](api-management-policies.md#authentication-and-authorization).
130
129
131
130
## Test your API
132
131
133
132
1. Navigate to your API Management instance.
134
-
1. In the left navigation pane, in the **APIs** section, select **APIs**.
133
+
134
+
1. In the sidebar menu, select **APIs** > **APIs**.
135
+
135
136
1. Under **All APIs**, select your imported API.
137
+
136
138
1. Select the **Test** tab to access the test console.
139
+
137
140
1. Select an operation, enter any required values, and then select **Send**.
138
141
139
142
For example, test the `GET /$metadata` call to verify connectivity to the SAP backend.
140
143
141
144
1. View the response. To troubleshoot, [trace](api-management-howto-api-inspector.md) the call.
145
+
142
146
1. When you're done testing, exit the test console.
143
147
144
148
---
@@ -148,7 +152,7 @@ You also need to configure authentication to your backend by using an appropriat
148
152
* 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
153
* 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
154
* 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).
152
-
*[CI/CD for API Management using Azure Resource Manager templates](devops-api-development-templates.md).
155
+
*[Automated API deployments with APIOps](/azure/architecture/example-scenario/devops/automated-api-deployments-apiops)
156
+
*[Use DevOps and CI/CD to publish APIs](devops-api-development-templates.md)
In this tutorial, you learn how to use the API Management extension for Visual Studio Code for common operations in API Management. Use the familiar Visual Studio Code environment to import, update, test, and manage APIs.
18
+
In this tutorial, you learn how to use the Azure API Management extension for Visual Studio Code for common operations in API Management. You can use the familiar Visual Studio Code environment to import, update, test, and manage APIs.
:::image type="content" source="media/visual-studio-code-tutorial/tutorial-api-result.png" alt-text="Screenshot of API in API Management extension.":::
30
+
:::image type="content" source="media/visual-studio-code-tutorial/tutorial-api-result.png" alt-text="Screenshot of API in API Management extension." lightbox="media/visual-studio-code-tutorial/tutorial-api-result.png":::
31
31
32
-
For an introduction to more API Management features, see the API Management tutorials using the [Azure portal](import-and-publish.md).
32
+
For an introduction to more API Management features, see [Import and publish your first API](import-and-publish.md).
33
33
34
34
## Prerequisites
35
35
36
36
* Understand [Azure API Management terminology](api-management-terminology.md).
37
-
*Ensure you've installed [Visual Studio Code](https://code.visualstudio.com/) and the latest [Azure API Management extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-apimanagement&ssr=false#overview).
38
-
*[Create an API Management instance](vscode-create-service-instance.md).
37
+
*Install [Visual Studio Code](https://code.visualstudio.com) and the latest [Azure API Management extension for Visual Studio Code](https://marketplace.visualstudio.com/items?itemName=ms-azuretools.vscode-apimanagement&ssr=false#overview).
38
+
* Create an [API Management instance](vscode-create-service-instance.md).
39
39
40
40
## Import an API
41
41
42
-
The following example imports an OpenAPI Specification in JSON format into API Management. For this example, you import the open source [Petstore API](https://petstore.swagger.io/).
42
+
The following example imports an OpenAPI Specification in JSON format into API Management. For this example, you import the open source [Petstore API](https://petstore.swagger.io).
43
43
44
44
1. In Visual Studio Code, select the Azure icon from the Activity Bar.
45
+
45
46
1. In the Explorer pane, expand the API Management instance you created.
47
+
46
48
1. Right-click **APIs**, and select **Import from OpenAPI Link**.
49
+
47
50
1. When prompted, enter the following values:
48
51
1. An **OpenAPI link** for content in JSON format. For this example: `https://petstore.swagger.io/v2/swagger.json`.
49
52
50
53
This file specifies the backend service that implements the example API and the operations it supports.
51
-
1. An **API name**, such as *petstore*, that is unique in the API Management instance. This name can contain only letters, number, and hyphens. The first and last characters must be alphanumeric. This name is used in the path to call the API.
54
+
1. An **API name**, such as *petstore*, that's unique in the API Management instance. This name can contain only letters, number, and hyphens. The first and last characters must be alphanumeric. This name is used in the path to call the API.
52
55
53
56
After the API is imported successfully, it appears in the Explorer pane, and available API operations appear under the **Operations** node.
54
57
@@ -58,10 +61,10 @@ After the API is imported successfully, it appears in the Explorer pane, and ava
58
61
59
62
You can edit the API in Visual Studio Code. For example, edit the Resource Manager JSON description of the API in the editor window to remove the **http** protocol used to access the API, which is highlighted in the following snip:
60
63
61
-
:::image type="content" source="media/visual-studio-code-tutorial/import-demo-api.png" alt-text="Screenshot of editing JSON description in Visual Studio Code.":::
62
-
63
64
To edit the OpenAPI format, right-click the API name in the Explorer pane and select **Edit OpenAPI**. Make your changes, and then select **File** > **Save**.
64
65
66
+
:::image type="content" source="media/visual-studio-code-tutorial/import-demo-api.png" alt-text="Screenshot of editing JSON description in Visual Studio Code.":::
67
+
65
68
## Apply policies to the API
66
69
67
70
API Management provides [policies](api-management-policies.md) that you can configure for your APIs. Policies are a collection of statements. These statements are run sequentially on the request or response of an API. Policies can be global, which apply to all APIs in your API Management instance, or specific to a product, an API, or an API operation.
@@ -89,7 +92,7 @@ This section shows how to apply common inbound and outbound policies to your API
89
92
</policies>
90
93
```
91
94
92
-
* The `rate-limit` policy in the `inbound` section limits the number of calls to the API to 3 every 15 seconds.
95
+
* The `rate-limit` policy in the `inbound` section limits the number of calls to the API to 3 calls every 15 seconds.
93
96
* The `set-header` policy in the `outbound` section adds a custom response header for demonstration purposes.
94
97
95
98
1. Save the file. If you're prompted, select **Upload** to upload the file to the cloud.
@@ -103,6 +106,7 @@ To test the API, get a subscription key and then make a request to the API Manag
103
106
You need a subscription key for your API Management instance to test the imported API and the policies that are applied.
104
107
105
108
1. In the Explorer pane, right-click the name of your API Management instance.
109
+
106
110
1. Select **Copy Subscription Key**. This key is for the built-in all access subscription that is created when you create an API Management instance.
107
111
108
112
:::image type="content" source="media/visual-studio-code-tutorial/copy-subscription-key-1.png" alt-text="Screenshot of Copy subscription Key command in Visual Studio Code.":::
@@ -113,12 +117,16 @@ You need a subscription key for your API Management instance to test the importe
113
117
### Test an API operation
114
118
115
119
1. In the Explorer pane, expand the **Operations** node under the *petstore* API that you imported.
120
+
116
121
1. Select an operation such as *[GET] Find pet by ID*, and then right-click the operation and select **Test Operation**.
122
+
117
123
1. In the editor window, substitute `5` for the `petId` parameter in the request URL.
124
+
118
125
1. In the editor window, next to **Ocp-Apim-Subscription-Key**, paste the subscription key that you copied.
126
+
119
127
1. Select **Send request**.
120
128
121
-
:::image type="content" source="media/visual-studio-code-tutorial/test-api.png" alt-text="Screenshot of sending API request from Visual Studio Code.":::
129
+
:::image type="content" source="media/visual-studio-code-tutorial/test-api.png" alt-text="Screenshot of sending API request from Visual Studio Code.":::
122
130
123
131
When the request succeeds, the backend responds with **200 OK** and some data.
124
132
@@ -140,18 +148,13 @@ For steps to enable tracing for an API, see [Enable tracing for an API](api-mana
140
148
141
149
When no longer needed, remove the API Management instance by right-clicking and selecting **Open in Portal** to [delete the API Management service](get-started-create-service-instance.md#clean-up-resources) and its resource group.
142
150
143
-
Alternately, you can select **Delete API Management** to only delete the API Management instance (this operation doesn't delete its resource group).
151
+
Alternately, you can select **Delete API Management** to only delete the API Management instance. This operation doesn't delete its resource group.
144
152
145
153
:::image type="content" source="media/visual-studio-code-tutorial/vscode-apim-delete-1.png" alt-text="Screenshot of deleting API Management instance from Visual Studio Code.":::
146
154
147
155
## Related content
148
156
149
-
This tutorial introduced several features of the API Management extension for Visual Studio Code. You can use these features to import and manage APIs. You learned how to:
150
-
151
-
> [!div class="checklist"]
152
-
> * Import an API into API Management
153
-
> * Edit the API
154
-
> * Apply API Management policies
155
-
> * Test the API
157
+
The API Management extension provides more features to work with your APIs, such as:
156
158
157
-
The API Management extension provides more features to work with your APIs. For example, [debug polices](api-management-debug-policies.md) (available in the Developer service tier), or create and manage [named values](api-management-howto-properties.md).
159
+
- [Create, understand, and debug Azure API Management policies](api-management-debug-policies.md) (available in the Developer service tier)
160
+
- [Use named values in Azure API Management policies](api-management-howto-properties.md)
0 commit comments