Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
APPLIES TO: All API Management tiers
This article describes how to import an OData service by using its metadata description. SAP Gateway Foundation is used as an example.
In this article, you:
- Retrieve OData metadata from your SAP service
- Import OData metadata to Azure API Management, either directly or after converting it to an OpenAPI specification
- Complete API configuration
- Test the API in the Azure portal
Prerequisites
An API Management instance. If you don't have one, complete the steps in Create an API Management instance by using the Azure portal.
An SAP system and service that's exposed as OData v2 or v4.
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 in your API Management instance:
- In the Azure portal, under APIs, select Backends > + Add.
- Add a Custom URL that points to the SAP backend service.
- Clear the Validate certificate chain and Validate certificate name checkboxes.
Note
In production scenarios, use proper certificates for end-to-end SSL verification.
Retrieve OData metadata from your SAP service
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.
- Use the SAP Gateway Client (transaction
/IWFND/GW_CLIENT
).
or - Make a direct HTTP call to retrieve the XML:
http://<OData server URL>:<port>/<path>/$metadata
.
Go to your API Management instance
In the Azure portal, search for and select API Management services:
On the API Management services page, select your API Management instance:
Import an API to API Management
Choose one of the following methods to import your API to API Management:
- Import the metadata XML as an OData API directly.
- Convert the metadata XML to an OpenAPI specification.
Import OData metadata
In the left menu, select APIs > APIs, and then select + Add API.
Under Create from definition, select OData:
Enter API settings. You can update your settings later by going to the Settings tab of the API.
In OData specification, enter a URL for an OData metadata endpoint. This value is typically the URL to the service root, appended with
/$metadata
. Alternatively, select a local OData XML file to import.Enter additional settings to configure your API. These settings are explained in the Import and publish your first API tutorial.
Select Create.
The API is added to the list of APIs. The entity sets and functions that are exposed in the OData metadata description appear on the API's Entity sets and functions tab.
Update the OData schema
You can access an editor in the portal to view your API's OData schema. If the API changes, you can also update the schema in API Management from a file or an OData service endpoint.
In the portal, navigate to your API Management instance.
In the left menu, select APIs, and then select your OData API.
On the Entity sets and functions tab, select the ellipsis (...) next to an entity set or function, and then select Edit.
Review the schema. If you want to update it, select Update from file or Update schema from endpoint.
Test your OData API
In the left menu, select APIs, and then select your OData API.
On the Entity sets and functions tab, select the ellipsis (...) next to an entity set or function, and then select Test.
In the test console, enter template parameters, query parameters, and headers for your test, and then select Test. For more information about testing APIs in the portal, see Test the new API in the portal.
Secure your OData API
Secure your OData API by applying existing authentication and authorization policies and an OData validation policy to protect against attacks through OData API requests.
Tip
In the portal, configure policies for your OData API on the API policies tab.
Production considerations
- See an example end-to-end scenario for integrating API Management with an SAP gateway.
- 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 policy. There are also policy snippets for SAP principal propagation for SAP ECC or S/4HANA or SAP SuccessFactors and fetching an X-CSRF token.
- For guidance on deploying, managing, and migrating APIs at scale, see:
Related content
- API import limitations
- Import an OpenAPI specification
- Import a SOAP API
- Import a SOAP API and convert it to REST
- Import an App Service API
- Import a Container App API
- Import a WebSocket API
- Import a GraphQL API
- Import a GraphQL schema and set up field resolvers
- Import an Azure Function App API
- Import an Azure Logic App API
- Import a Service Fabric service
- Import an Azure OpenAI API
- Import an OData API
- Import SAP OData metadata
- Import a gRPC API
- Edit an API