|
| 1 | +--- |
| 2 | +title: Migrate API Portal with Azure Spring Apps Enterprise Plan to Azure API Management |
| 3 | +description: Describes how to migrate API Portal to Azure API Management. |
| 4 | +author: KarlErickson |
| 5 | +ms.author: dixue |
| 6 | +ms.service: azure-spring-apps |
| 7 | +ms.topic: upgrade-and-migration-article |
| 8 | +ms.date: 01/29/2025 |
| 9 | +ms.custom: devx-track-java, devx-track-extended-java |
| 10 | +--- |
| 11 | + |
| 12 | +# Migrate API Portal with Azure Spring Apps Enterprise plan to Azure API Management |
| 13 | + |
| 14 | +[!INCLUDE [deprecation-note](../includes/deprecation-note.md)] |
| 15 | + |
| 16 | +**This article applies to:** ❎ Basic/Standard ✅ Enterprise |
| 17 | + |
| 18 | +This article describes how to migrate API Portal to Azure API Management. |
| 19 | + |
| 20 | +Azure API Management provides a centralized interface for viewing API definitions and testing specific API routes directly from the browser. It also supports single sign-on (SSO) for improved security and seamless access. Migrating from API Portal with Azure Spring Apps to Azure API Management enhances scalability, security, and integration with other Azure services. |
| 21 | + |
| 22 | +## Prerequisites |
| 23 | + |
| 24 | +- An existing Azure Spring Apps Enterprise plan instance with API Portal enabled. |
| 25 | +- An existing Azure container app. For more information, see [Quickstart: Deploy your first container app using the Azure portal](../../container-apps/quickstart-portal.md). |
| 26 | + |
| 27 | +## Create an API Management instance |
| 28 | + |
| 29 | +Use the following steps to create an API Management instance: |
| 30 | + |
| 31 | +1. In the Azure portal, search for **API Management** in the search bar. |
| 32 | +1. Select **API Management services** from the results and then select **Create**. |
| 33 | +1. Provide the following required information: |
| 34 | + |
| 35 | + - **Subscription**: Select the Azure subscription for your service. |
| 36 | + - **Resource Group**: Either select an existing resource group or select **Create new** to create a new one. |
| 37 | + - **Region**: Choose the location or region for your API Management instance. |
| 38 | + - **Resource Name**: Provide a globally unique name for the API Management instance. |
| 39 | + - **Organization Name**: Specify the name of your organization. |
| 40 | + - **Administrator Email**: Provide an email address that is used for notifications related to the API Management instance. |
| 41 | + |
| 42 | +1. Choose the pricing tier based on your use case. You can always upgrade or change the pricing tier later. |
| 43 | +1. Configure optional settings like monitoring and virtual network settings. |
| 44 | +1. Select **Review + create** to review the settings and validate the configuration. |
| 45 | +1. After validation is complete, select **Create**. Deployment can take 30 to 40 minutes. |
| 46 | +1. After the deployment is complete, navigate to the **API Management service** page to view the newly created service. |
| 47 | + |
| 48 | +## Import exposed APIs in API Management |
| 49 | + |
| 50 | +There are two options to import APIs in API Management: manually adding APIs or importing an API specification file. |
| 51 | + |
| 52 | +### Manually add APIs |
| 53 | + |
| 54 | +Use the following steps to manually add APIs: |
| 55 | + |
| 56 | +1. Navigate to the API Management instance in the Azure portal. Under the **APIs** section, select **Add API**. |
| 57 | + |
| 58 | +1. On the **Define a new API** pane, select the **HTTP** option to manually define an HTTP API. |
| 59 | + |
| 60 | +1. Provide the following **API Basics** values, and then select **Create** to save: |
| 61 | + |
| 62 | + - **Display Name**: Provide a name for your API. |
| 63 | + - **Name**: Enter a unique identifier for the API. |
| 64 | + - **Web Service URL**: Specify the base URL of your backend API of your Container Apps. |
| 65 | + - **API URL Suffix**: Define the suffix for this API - for example, **/api/customers-service**. |
| 66 | + |
| 67 | +1. To create new API endpoints, select **Add Operation**, then use the following steps: |
| 68 | + |
| 69 | + 1. Provide the general information. Input **Display name** and **Name**. |
| 70 | + 1. Provide the details for the operation, such as the **HTTP verb** - `GET`, `POST`, and so on - **URL**, **Query Parameters**, **Request**, and **Response**. |
| 71 | + 1. After you add all operations, save your API. |
| 72 | + |
| 73 | +1. Select the names of the APIs added. You can see all operations added in the **Design** tab. |
| 74 | + |
| 75 | +### Import an API specification file |
| 76 | + |
| 77 | +If you have an OpenAPI specification - a Swagger definition - of your APIs, you can directly import to API Management by using the following steps: |
| 78 | + |
| 79 | +1. Navigate to the API Management instance in the Azure portal. |
| 80 | + |
| 81 | +1. Open the **APIs** section under **APIs**. |
| 82 | + |
| 83 | +1. Select **Add API**. |
| 84 | + |
| 85 | +1. For **Create from definition**, choose the **OpenAPI** option, which creates a standard, language-agnostic interface to REST APIs. |
| 86 | + |
| 87 | +1. Use the following steps to create an API from an OpenAPI specification: |
| 88 | + |
| 89 | + 1. If you have a local API spec file, select **Select a file** to upload the file. Alternatively, provide a publicly accessible **URL** to the OpenAPI specification. |
| 90 | + 1. You can further refine the API settings by providing values for **Display Name**, **Name**, and **API URL suffix** for the APIs. |
| 91 | + 1. To save the configurations, select **Create**. |
| 92 | + |
| 93 | +1. Select the name of APIs added. You can see all the operations added on the **Design** tab. |
| 94 | + |
| 95 | +## Try out APIs in API Management |
| 96 | + |
| 97 | +Azure API Management provides a built-in **Test Console** within the Azure portal, making it easy to interact with your APIs without needing external tools. Use the following steps to test your APIs: |
| 98 | + |
| 99 | +1. Navigate to the API Management instance in the Azure portal. |
| 100 | + |
| 101 | +1. Under the **APIs** section, select the API you want to test from the list. |
| 102 | + |
| 103 | +1. Choose an operation. Inside the API's overview page, you can see a list of available operations (endpoints). Select the operation you want to test. |
| 104 | + |
| 105 | +1. Select the **Test** tab to open it within the Azure portal. |
| 106 | + |
| 107 | +1. Configure request parameters. Enter the necessary parameters for the request such as **Path Parameters**, **Query Parameters**, **Headers**, or **Body**, depending on the API method. If an API requires an `Authorization Token`, make sure to include it in the header. |
| 108 | + |
| 109 | +1. Send the request. After you provide the request details, select **Send**. The response from the API is shown directly in the Azure portal, including the **Response Code**, **Response Body**, and **Headers**. |
| 110 | + |
| 111 | +1. Inspect the response. Review the response data, status codes, and any error messages that might indicate issues with the API or request. |
| 112 | + |
| 113 | +## Migrate single sign-on to API Management |
| 114 | + |
| 115 | +If you enable single sign-on (SSO) in API Portal, and want to authenticate requests to API Management as well, use the following steps to configure the identity in API Management: |
| 116 | + |
| 117 | +1. In the Azure portal, go to your API Management instance. |
| 118 | + |
| 119 | +1. Navigate to **Developer portal** > **identities**. |
| 120 | + |
| 121 | +1. Select **Add** and then select **Azure Active Directory**. |
| 122 | + |
| 123 | +1. Fill in the required fields: |
| 124 | + |
| 125 | + - **Client ID**: The application or client ID of your registered Microsoft Entra ID application. |
| 126 | + - **Client Secret**: The secret of the Microsoft Entra ID application. |
| 127 | + - **Signin tenant**: The domain name of your Microsoft Entra ID tenant, such as `yourcompany.onmicrosoft.com` |
| 128 | + - **Redirect URL**: Typically `https://{your-apim-instance}.developer.azure-api.net/signin`. |
| 129 | + |
| 130 | +1. Select **Add** to save the identity provider. |
| 131 | + |
| 132 | +You need to add the redirect URL to the list of allowed redirect URLs of your Microsoft Entra ID client app before saving the new added identity provider. |
| 133 | + |
| 134 | +For more configurations for API Management, see the [API Management documentation](../../api-management/index.yml). |
0 commit comments