0
votes

I'm able to upload the swagger Json to Azure API management manually, It's working as expected. But I need to automate this process via azure DevOps CICD.

I need to download or fetch the swagger Json from running pod. Then I need to upload and update it in Azure API management.

I'm quite new to the process, anyone please advise me steps/tasks for the same.

Reference

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

1
Hi, How about the issue? Does the answer below resolved your question? If not, would you please let me know the latest information about this issue?Vito Liu
Hi, Just checking in to see whether this issue is still blocking you now? Any update for this issue?Vito Liu
Thanks @VitoLiu-MSFT. It helps :)Debugger

1 Answers

1
votes

We could add task PowerShell or azure PowerShell to Import Swagger JSON to Azure API Management. This step refers to the hosted function app URL of swagger function. You can use the PowerShell command Import-AzApiManagementApi. Below is a sample of command.

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

We could also refer to this blog for more details.