@Prem Jha I would like to share an example that I have tested and its steps.
- Created an apim service using ARM template https://github.com/Azure/azure-quickstart-templates/tree/master/quickstarts/microsoft.apimanagement/api-management-create-all-resources and deployed it using portal (or CLI as well)
- Then cloned GIT repository https://github.com/Azure/azure-api-management-devops-resource-kit in my local machine.
- Restored packages using dotnet restore and set subscription using Azure CLI as mentioned in docs: https://github.com/Azure/azure-api-management-devops-resource-kit/blob/main/src/README.md#extractor
- Ran "dotnet run extract --sourceApimName <apim service name> --destinationApimName <apim service name> --resourceGroup <my resourcegroup> --fileFolder c:\temp\apim-extract --apiName exampleApi" to extract ARM template for exampleAPI.
- Reviewed ARM template generated for exampleAPI in "C:\temp\apim-extract\<apim service name>-exampleApi-api.template.json" and then updated ARM template for my need.
- Then deployed the template successfully using az deployment group create (refer docs: https://learn.microsoft.com/en-us/cli/azure/deployment/group?view=azure-cli-latest#az-deployment-group-create)
(example: az deployment group create --name SampleUpdate --resource-group <my resourcegroup> --template-file "C:\temp\apim-extract\<apim service name>-exampleApi-api.template.json" --parameters "C:\temp\apim-extract\<apim service name>-parameters.json")
I hope these steps help with your question and feel free to add if you have any questions on CI/CD pipeline configuration. I would be happy to assist you.
References:
Azure API Management DevOps Resource Kit
Use DevOps and CI/CD to publish APIs
Extractor tool
Please 'Accept as answer' and ‘Upvote’ if it helped so that it can help others in the community looking for help on similar topics.