While not a perfect solution, the Azure RM API Management PowerShell library helped me to build a PowerShell script that gets me most of what I wanted, but still requires a little manual labor.
In PowerShell, I created an array
of operation IDs that I want to move, then used a combination of the following functions in a for-each
loop to 'move' the operations
to the desired API:
- Get-AzureRmApiManagementOperation - Used to read the existing operation.
- New-AzureRmApiManagementOperation - Used to create a new operation based on the existing one created by mapping the results of the Get function to this New function. Note that there is a 1000 character limit on the Description field.
- Remove-AzureRmApiManagementOperation - Used to remove the operation from the old API location. I don't recommend using this unless you are darn sure the previous steps worked exactly as you want. Because I ran into an issue where the operation description field can only be 1000 characters or less, I'm glad I didn't delete the operation from the old location because I had to manually copy/paste the description into the new location.
While the above functions will help in copying the operations
, the policies
within each operation
won't be copied. Therefore, the following functions can be used to ensure the policies
are copied as well: