如何解决通过 Azure Devops Pipeline
我可以手动将 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
解决方法
我们可以添加任务 PowerShell
或 azure 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 了解更多详情。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。