How to create Azure Function from OpenAPI/Swagger definition?

Raju RH
2 min readNov 6, 2020

--

In my previous blog post, I have illustrated how to setup OpenAPI/Swagger UI for Azure Function. In this blog, post let’s see how to create Azure Function from OpenAPI specification. As part of recent updates from the Azure Functions team, there was an announcement for creating Azure Function by importing OpenAPI/Swagger definition.

Prerequisites

  • Azure Function VS Code extension or command line
  • autorest (Microsoft’s OpenAPI specification generator) npm installed
npm install -g autorest
  • Supported languages C#, Java, Python, TypeScript.

Steps to create function apps from Swagger definition

  • Install or update VS code with Azure Function extension
  • Navigate to Visual Studio Code à Azure Extension under which you should be able to see the option for creating Function App as shown in the below screenshot.
  • Once the folder is selected under which Function App to be placed, choose the language (c#), template, and namespace for the function app as shown below.
  • Using AutoRest tool based on the input file (OpenAPI) provided Function App will be created

1. Input OpenAPI Definition as shown below

2. Function App generated from the above OpenAPI definition shown below

References

More language support and details can be found here

Originally published at https://rajurh.blogspot.com on November 6, 2020.

--

--

Raju RH
Raju RH

Written by Raju RH

Specialties: Azure,.Net Core, Docker, Containers, Azure DevOps, Cognitive Services (AI)

No responses yet