【问题标题】:Import Swagger JSON to Azure existing API Management via - Azure Devops Pipeline通过 - Azure Devops Pipeline 将 Swagger JSON 导入 Azure 现有 API 管理
【发布时间】:2021-05-14 21:27:13
【问题描述】:

我能够手动将 swagger Json 上传到 Azure API 管理,它按预期工作。但我需要通过 azure DevOps CICD 自动化这个过程。

我需要从正在运行的 pod 下载或获取 swagger Json。然后我需要在 Azure API 管理中上传和更新它。

我对这个过程很陌生,请任何人告诉我相同的步骤/任务。

参考

https://docs.microsoft.com/en-us/azure/api-management/import-and-publish

how to import swagger in Azure API Management

https://marketplace.visualstudio.com/items?itemName=stephane-eyskens.apim

https://github.com/Azure/azure-api-management-devops-resource-kit

【问题讨论】:

  • 嗨,这个问题怎么样?下面的答案是否解决了您的问题?如果没有,请告诉我有关此问题的最新信息吗?
  • 您好,刚刚检查一下这个问题现在是否仍然阻碍您?这个问题有更新吗?

标签: .net azure azure-devops swagger azure-api-management


【解决方案1】:

我们可以添加任务 PowerShellazure PowerShell 以将 Swagger JSON 导入 Azure API 管理。这一步是指swagger函数的托管函数应用URL。您可以使用 PowerShell 命令Import-AzApiManagementApi。下面是一个命令示例。

Import-AzApiManagementApi -Context $ApiMgmtContext -SpecificationFormat "Swagger" -SpecificationPath "C:\contoso\specifications\echoapi.swagger" -Path "apis"

我们也可以参考这个blog了解更多详情。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2021-03-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-05-05
    • 1970-01-01
    • 1970-01-01
    • 2020-02-24
    相关资源
    最近更新 更多