【问题标题】:Azure Function App documentation using API Management使用 API 管理的 Azure Function App 文档
【发布时间】:2020-12-13 09:02:46
【问题描述】:

我创建了一个 Azure Function App。函数应用连接到 SQL DB 并具有以下功能

  1. 返回表中的所有记录
  2. 使用以下代码根据列名返回记录
public static async Task<IActionResult> 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.");
        }

我想使用 API Management/Swagger 记录函数应用。你能告诉我这是如何实现的吗?

提前致谢

【问题讨论】:

    标签: azure api azure-functions swagger azure-api-management


    【解决方案1】:

    您只需要从门户创建一个 API 管理服务实例,并使用开放的 api 添加功能端点。

    您可以关注此documentation,了解如何做同样的事情。

    【讨论】:

      猜你喜欢
      • 2021-10-20
      • 2019-11-16
      • 1970-01-01
      • 2019-02-28
      • 1970-01-01
      • 1970-01-01
      • 2019-10-15
      • 2018-03-16
      • 2020-03-11
      相关资源
      最近更新 更多