Edit

Share via


Import an OData API

APPLIES TO: All API Management tiers

This article shows how to import an OData-compliant service as an API in API Management.

In this article, you learn how to:

  • Import an OData metadata description using the Azure portal
  • Manage the OData schema in the portal
  • Secure the OData API

Prerequisites

Go to your API Management instance

  1. In the Azure portal, search for and select API Management services:

    Screenshot that shows API Management services in the search results.

  2. On the API Management services page, select your API Management instance:

    Screenshot that shows an API Management instance on the API Management services page.

Import OData metadata

  1. In the left menu, select APIs > APIs, and then select + Add API.

  2. Under Create from definition, select OData:

    Screenshot of creating an API from an OData description in the portal.

  3. Enter API settings. You can update your settings later by going to the Settings tab of the API.

    1. 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.

    2. Enter additional settings to configure your API. These settings are explained in the Import and publish your first API tutorial.

  4. 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.

    Screenshot that shows OData entity sets and functions.

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.

  1. In the portal, navigate to your API Management instance.

  2. In the left menu, select APIs, and then select your OData API.

  3. On the Entity sets and functions tab, select the ellipsis (...) next to an entity set or function, and then select Edit.

    Screenshot that shows the location of the Edit command.

  4. Review the schema. If you want to update it, select Update from file or Update schema from endpoint.

    Screenshot of the schema editor for an OData API.

Test your OData API

  1. In the left menu, select APIs, and then select your OData API.

  2. On the Entity sets and functions tab, select the ellipsis (...) next to an entity set or function, and then select Test.

    Screenshot that shows the Test command.

  3. 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.

Append other APIs

You can compose an API out of APIs that are exposed by different services, including:

  • An OpenAPI specification
  • A SOAP API
  • A GraphQL API
  • A Web App that's hosted in Azure App Service
  • Azure Functions
  • Azure Logic Apps
  • Azure Service Fabric

Note

When you import an API, the operations are appended to your current API.

To append an API to an existing API:

  1. Go to your Azure API Management instance in the Azure portal:

    Screenshot that shows the API Management services page.

  2. Select APIs on the Overview page or select APIs > APIs in the menu on the left.

    Screenshot that shows the APIs selection on the Overview page.

  3. Select the ellipsis (...) next to the API that you want to append another API to.

  4. Select Import from the drop-down menu:

    Screenshot that shows the Import command.

  5. Select a service from which to import an API.


Additional resources

Documentation