Expose serverless APIs from HTTP endpoints using Azure API Management
Članak
Azure Functions integrates with Azure API Management in the portal to let you expose your HTTP trigger function endpoints as REST APIs. These APIs are described using an OpenAPI definition. This JSON (or YAML) file contains information about what operations are available in an API. It includes details about how the request and response data for the API should be structured. By integrating your function app, you can have API Management generate these OpenAPI definitions.
The same resource as your function app, which should get set for you.
Location
Location of the service
Consider choosing the same location as your function app.
Organization name
Contoso
The name of the organization used in the developer portal and for email notifications.
Administrator email
your email
Email that received system notifications from API Management.
Pricing tier
Consumption
Consumption tier isn't available in all regions. For complete pricing details, see the API Management pricing page
Choose Export to create the API Management instance, which may take several minutes.
After Azure creates the instance, it enables the Enable Application Insights option on the page. Select it to send logs to the same place as the function application.
Import functions
After the API Management instance is created, you can import your HTTP triggered function endpoints. This example imports an endpoint named TurbineRepair.
In the API Management page, select Link API.
The Import Azure Functions opens with the TurbineRepair function highlighted. Choose Select to continue.
In the Create from Function App page, accept the defaults, and then select Create.
Azure creates the API for the function.
Download the OpenAPI definition
After your functions have been imported, you can download the OpenAPI definition from the API Management instance.
Select Download OpenAPI definition at the top of the page.
Save the downloaded JSON file, and then open it. Review the definition.
Build end-to-end solutions in Microsoft Azure to create Azure Functions, implement and manage web apps, develop solutions utilizing Azure storage, and more.
Use Visual Studio to create an HTTP triggered function that uses an OpenAPI definition (formerly swagger) to expose a serverless API using API Management.