简体   繁体   中英

Azure Function App documentation using API Management

I have created a Azure Function App. The function app connects to a SQL DB and has the following features

  1. Return all the records in a table
  2. Returns the records based on the column name using the below code

public static async Task Run( [HttpTrigger(AuthorizationLevel.Function, "get", "post", Route = null)] HttpRequest req, ILogger log) { string loan_id = req.Query["loanid"]; string loan_amount = req.Query["loanamount"];

        if (string.IsNullOrEmpty(loan_id)) {
            //Do something when dont give loan id.
        } else if (string.IsNullOrEmpty(loan_amount)) { 
            //DO something when dont give loan amount.
        }

        return new OkObjectResult("This is a test.");
    }

I would like to document the function app using API Management/Swagger. Can you please let me know how this can be achieved?

Thanks in advance

You just need to create an API management service instance from the portal and add the function endpoint using the open api.

You can follow this documentation on how to do the same.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM