Search code examples
azureazure-api-managementazure-cliapim

Deployment failed. Correlation ID: x. API with specified name 'x' already exists


Im getting this error: Deployment failed. Correlation ID: x. API with specified name 'x' already exists.

when trying to deploy an api to apim with the az cli.

the command:

az apim api import --resource-group x --service-name x --path x --specification-format OpenApi --specification-path x --api-id x --protocols https --service-url x

I already have this api deployed in apim but i want to update it what is the best approach?


Solution

  • You can use az apim api update to update an API Management API.

    Or call this API Apis - Create Or Update to create new or updates the existing specified API of the API Management service instance.

    Or re-import a Swagger file in place in which case the operations are replaced with their new definitions and any policies you have set will be preserved. Refer to this.

    You could select one method that you are good at.