How to add public IP to APIM via CLI?

Shuchita Tripathi 1 Reputation point

I am trying to add separately managed public IP to Azure APIM (external) using CLI. Command is not giving any error but IP is not getting attached.
az resource update --ids "<apim-id>" --set properties.publicIPAddresses="20.x.x.x"


For reference, this is what I am trying to do:

How can I add a separately managed public IP to APIM using automation? (preferably CLI, however powershell will also help). Separately managed IP refers to IP created using create public IP command, and then attaching that to APIM.

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

1 answer

Sort by: Most helpful
  1. MayankBargali-MSFT 67,991 Reputation points

    @Shuchita Tripathi Currently, the Azure portal uses API version 2021-01-01 preview when creating or updating an API Management instance. You can specify this API version using an Azure Resource Manager template or the API Management REST API. The Azure CLI and Azure PowerShell currently support API version 2020-12-01.

    When I test with AZ CLI version is 2.25.0/2.26.0 then I observe the Bad Request as it is expected as the Azure CLI doesn't support this functionality yet. The same is documented here.
    ERROR: Operation returned an invalid status 'Bad Request'

    You should observe the same behavior. You can try running the command with --debug to get more details on the request and error message.

    For any CLI feature/feedback/issue you can always post your query here.