ईवेंट्स
17 मार्च, 9 pm - 21 मार्च, 10 am
साथी डेवलपर्स और विशेषज्ञों के साथ वास्तविक दुनिया के उपयोग के मामलों के आधार पर स्केलेबल एआई समाधान बनाने के लिए मीटअप श्रृंखला में शामिल हों।
अभी पंजीकरण करेंयह ब्राउज़र अब समर्थित नहीं है.
नवीनतम सुविधाओं, सुरक्षा अपडेट और तकनीकी सहायता का लाभ लेने के लिए Microsoft Edge में अपग्रेड करें.
APPLIES TO: All API Management tiers
This article shows how to import an Azure Web App to Azure API Management and test the imported API, using the Azure portal.
नोट
Currently, this feature isn't available in workspaces.
In this article, you learn how to:
Azure App Service is an HTTP-based service for hosting web applications, REST APIs, and mobile backends. API developers can use their preferred technology stacks and pipelines to develop APIs and publish their API backends as Web Apps in a secure, scalable environment. Then, use API Management to expose the Web Apps, manage and protect the APIs throughout their lifecycle, and publish them to consumers.
API Management is the recommended environment to expose a Web App-hosted API, for several reasons:
For more information, see About API Management.
API Management supports import of Web Apps hosted in App Service that include an OpenAPI definition (Swagger definition). However, an OpenAPI definition isn't required.
If the Web App is configured with an OpenAPI definition, API Management will detect that. Alternatively, you can manually import the definition to API Management. API Management then creates API operations that map directly to the definition, including required paths, parameters, and response types.
Having an OpenAPI definition is recommended, because the API is imported to API Management with high fidelity, giving you flexibility to validate, manage, secure, and update configurations for each operation separately.
If an OpenAPI definition isn't provided, API Management generates wildcard operations for the common HTTP verbs (GET, PUT, and so on). Append a required path or parameters to a wildcard operation to pass an API request through to the backend API.
With wildcard operations, you can still take advantage of the same API Management features, but operations aren't defined at the same level of detail by default. In either case, you can edit or add operations to the imported API.
Your backend Web App might support two GET operations:
https://myappservice.azurewebsites.net/customer/{id}
https://myappservice.azurewebsites.net/customers
You import the Web App to your API Management service at a path such as https://contosoapi.azureapi.net/store
. The following table shows the operations that are imported to API Management, either with or without an OpenAPI specification:
Type | Imported operations | Sample requests |
---|---|---|
OpenAPI specification | GET /customer/{id} GET /customers |
GET https://contosoapi.azureapi.net/store/customer/1 GET https://contosoapi.azureapi.net/store/customers |
Wildcard | GET /* |
GET https://contosoapi.azureapi.net/store/customer/1 GET https://contosoapi.azureapi.net/store/customers |
The wildcard operation allows the same requests to the backend service as the operations in the OpenAPI specification. However, the OpenAPI-specified operations can be managed separately in API Management.
Complete the following quickstart: Create an Azure API Management instance.
Make sure there is an App Service in your subscription. For more information, see App Service documentation.
For steps to create an example web API and publish as an Azure Web App, see:
In the Azure portal, search for and select API Management services.
On the API Management services page, select your API Management instance.
युक्ति
The following steps start the import by using Azure API Management in the Azure portal. You can also link to API Management directly from your Web App, by selecting API Management from the app's API menu.
Navigate to your API Management service in the Azure portal and select APIs from the menu.
Select App Service from the list.
Select Browse to see the list of App Services in your subscription.
Select an App Service. If an OpenAPI definition is associated with the selected Web App, API Management fetches it and imports it.
If an OpenAPI definition isn't found, API Management exposes the API by generating wildcard operations for common HTTP verbs.
Add an API URL suffix. The suffix is a name that identifies this specific API in this API Management instance. It has to be unique in this APIM instance.
Publish the API by associating the API with a product. In this case, the "Unlimited" product is used. If you want the API to be published and be available to developers, add it to a product. You can do it during API creation or set it later.
नोट
Products are associations of one or more APIs. You can include many APIs and offer them to developers through the developer portal. Developers must first subscribe to a product to get access to the API. When they subscribe, they get a subscription key that is good for any API in that product. If you created the APIM instance, you are an administrator already, so you are subscribed to every product by default.
By default, each API Management instance comes with two sample products:
Enter other API settings. You can set the values during creation or configure them later by going to the Settings tab. The settings are explained in the Import and publish your first API tutorial.
Select Create.
Operations can be called directly from the Azure portal, which provides a convenient way to view and test the operations of an API. You can also test the API in the developer portal or using your own REST client tools.
Select the API you created in the previous step.
Select the Test tab.
Select an operation.
The page displays fields for query parameters and fields for the headers. One of the headers is "Ocp-Apim-Subscription-Key", for the subscription key of the product that is associated with this API. If you created the API Management instance, you are an administrator already, so the key is filled in automatically.
Press Send.
When the test is successful, the backend responds with 200 OK and some data.
When wildcard operations are generated, the operations might not map directly to the backend API. For example, a wildcard GET operation imported in API Management uses the path /
by default. However, your backend API might support a GET operation at the following path:
/api/TodoItems
You can test the path /api/TodoItems
as follows.
Select the API you created, and select the operation.
Select the Test tab.
In Template parameters, update the value next to the wildcard (*) name. For example, enter api/TodoItems
. This value gets appended to the path /
for the wildcard operation.
Select Send.
You can compose an API of APIs exposed by different services, including:
Append a different API to your existing API using the following steps.
नोट
When you import another API, the operations are appended to your current API.
Go to your Azure API Management instance in the Azure portal.
Select APIs on the Overview page or from the menu on the left.
Click ... next to the API that you want to append another API to.
Select Import from the drop-down menu.
Select a service from which to import an API.
ईवेंट्स
17 मार्च, 9 pm - 21 मार्च, 10 am
साथी डेवलपर्स और विशेषज्ञों के साथ वास्तविक दुनिया के उपयोग के मामलों के आधार पर स्केलेबल एआई समाधान बनाने के लिए मीटअप श्रृंखला में शामिल हों।
अभी पंजीकरण करेंप्रशिक्षण
मॉड्यूल
Neste módulo, você aprenderá a montar várias funções do Azure em uma única API usando o Gerenciamento de API do Azure.
Certification
Microsoft Certified: Azure Developer Associate - Certifications
Crie soluções de ponta a ponta no Microsoft Azure para criar Funções do Azure, implementar e gerenciar aplicativos Web, desenvolver soluções utilizando o Armazenamento do Microsoft Azure e muito mais.
दस्तावेज़ीकरण
Adicionar uma API manualmente usando o portal do Azure
Este tutorial mostra como usar o Gerenciamento de API para adicionar uma API manualmente.
Gerenciamento de API do Azure – Visão geral e principais conceitos
Introdução aos principais cenários, funcionalidades e conceitos do serviço de Gerenciamento de API do Azure. O Gerenciamento de API dá suporte ao ciclo de vida completo da API.
Restrições e detalhes do suporte a formatos de API - Azure API Management
Detalhes de problemas conhecidos e restrições nos formatos Open API, WSDL e WADL têm suporte no Gerenciamento de API do Azure.