API management through ARM templates

Prem Jha 6 Reputation points

Hi ,

i have created API management using ARM templates and i have successfully added the API's in it through ARM by pulling API's from blob storage and it worked fine.

now i want to update the api in api management through ARM but i am not getting the import(append/update) option for ARM. please tell me what is the solution for this how can i update the existing api using ARM template.

Azure API Management
Azure API Management
An Azure service that provides a hybrid, multi-cloud management platform for APIs.
1,805 questions
{count} votes

1 answer

Sort by: Most helpful
  1. MuthuKumaranMurugaachari-MSFT 22,236 Reputation points

    @Prem Jha I would like to share an example that I have tested and its steps.

    1. 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)
    2. Then cloned GIT repository https://github.com/Azure/azure-api-management-devops-resource-kit in my local machine.
    3. 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
    4. 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.
    5. 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.
    6. 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.

    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.

    0 comments No comments