Closed san360 closed 10 months ago
Thank you for opening this issue! Please be patient while we will look into it and get back to you as this is an open source project. In the meantime make sure you take a look at the [closed issues](https://github.com/Azure/apiops/issues?q=is%3Aissue+is%3Aclosed) in case your question has already been answered. Don't forget to provide any additional information if needed (e.g. scrubbed logs, detailed feature requests,etc.).
Whenever it's feasible, please don't hesitate to send a Pull Request (PR) our way. We'd greatly appreciate it, and we'll gladly assess and incorporate your changes.
Thanks to @rbickel for support in troubleshooting and identifying the issue
@san360 Kindly post the solution here for others to benefit from in case they encounter a similar issue in the future.
@waelkdouh we were not able to resolve this issue via any workarounds (The only solution is to have API's published before Gateway is published and as mentioned above move the Gateway publish to the end in the Service.cs file), we took the latest from main branch and executed the code locally, In local execution it did not fail on the gateway part which was failing in the pipeline but it failed on AAD group migration part.
Release version
APIOps Toolkit for Azure APIM v4.10.3
Describe the bug
The publisher operation fails if APIM is configured with self hosted gateway and have API's published in it. It seems the tool publishes Gateway first and then goes to add API's which are not published at APIM yet.
The code from Service.cs publish Gateway first and then publishes API, Probably Gateway can be publsihed at the end.
https://github.com/Azure/apiops/blob/2713a1f7c5ff779bfefd7d5365d8b2157fea2209/tools/code/publisher/Service.cs#L43
Expected behavior
The Gateway along with all the API's are moved.
Actual behavior
The gateway is moved but API's are not and application fails
Reproduction Steps