Skip to main content Skip to complementary content

Updating an API definition in Azure API Management

Import a file to Azure API Management to update an existing definition.

Before you begin

  • You have access to Azure API Manangement.
  • You have installed Microsoft PowerShell. For more information, see the Microsoft PowerShell documentation.
  • You have installed the Azure PowerShell module. For more information, see the Microsoft Azure documentation.
  • You have exported your API definition.
  • You have uploaded a previous version of the API definition to Azure API Management.
  • You have set your context parameters as a variable. For more information, see the procedure above.

Procedure

  1. Open a command line and enter the following command to upload the file:
    Import-AzApiManagementApi -Context $ApiMgmtContext -SpecificationFormat "{format}" -SpecificationPath "{yourfile}" -ApiId "{api-id}" -Path "{api-url-suffix}"
  2. Add the correct parameters:
    Parameter Description
    {format} Format of the API definition to import. The value can be:
    • Swagger (recommended)
    • Wadl
    • Wsdl
    • OpenApi
    {yourfile} Path and file name of the API definition you exported.
    {api-id} Azure API Management ID of the API to update.
    {api-url-suffix} Web API path to add at the end of your API's public URL.
  3. Execute the command.

Results

Your API definition is imported and the new file replaces the previous version. You can check your update on the Azure portal.

In this example, a first version of the API definition named Contacts API, which contained five operations was uploaded. Then, it was replaced with a new definition named Contacts API V2 containing ten operations.

Screenshot of the updated API definition.

For more information about the Import-AzApiManagementApi command, see the Azure documentation.

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – please let us know!