Reputation: 792
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://learn.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
Upvotes: 2
Views: 3135
Reputation: 8298
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.
Upvotes: 3