0

I Have Azure HttpTrigger Java functions(get, Post) Those are Working Fine in Postman but, as per the Client Requirement I need To create swagger UI file for all those functions(Java) i am searching Refference stuff from lastweek, stil i did not get it,So plese any one share/guide/help me

  1. How to craete Azure HttpTriggerr Java function project with Springboot Application?
  2. How to add Swagger Configuration to it?
Balu
  • 9
  • 5

1 Answers1

1
  1. How to craete Azure HttpTriggerr Java function project with Springboot Application?

Following this MS Doc, created the Azure Functions Http Trigger in Spring boot.

1st Step is cloning the basic Function code of Sprint Boot Azure Functions Application. enter image description here

Step 2: In pom.xml, you have to change these properties accordingly:

<functionResourceGroup>HariTestRG</functionResourceGroup>
<functionAppName>my-spring-function-app</functionAppName>

Step 3: Clean and build the packages ./mvnw clean package and then run using the cmdlet ./mvnw azure-functions:run

enter image description here

Next is to deploy the function code to Azure Function App:

./mvnw azure-functions:deploy

Result: enter image description here

enter image description here

  1. How to add Swagger Configuration to it?

Go to the Azure Portal > Deployed Function App > Click on API Management on left Index > Import the Function App APIs in APIM Instance > Then you'll see the Open API Definition which generates the swagger UI file for all the functions:

enter image description here

enter image description here

  • Is it possible to generate swagger file for normal java functions(without springboot) because all my functions are non springboot functions so now it is challenging me to switch and i don't know spring boot also..... – Balu Nov 16 '22 at 18:28
  • Please Raise the new question on which language you're trying to create the Azure Functions and generate the swagger file and what you have tried! –  Nov 17 '22 at 03:37