Debugger
Debugger

Reputation: 792

Import Swagger JSON to Azure existing API Management via - Azure Devops Pipeline

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

Answers (1)

Vito Liu
Vito Liu

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

Related Questions