-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Question] How to not include "Managed" gateway by default when publishing APIs #501
Comments
|
I have my doubts that the proposed changes actually resolve this issue. |
I'm not sure what your baseline is, so I'll make some assumptions and walk through a few scenarios. Let's say you start with a managed and self-hosted gateway in the portal. You have zero APIs. You run the extractor. Your folder structure will be:
You then go to the Azure portal, create APIs A and B, assign API A to the managed gateway, and API B to the self-hosted gateway. You run the extractor. Your folder structure will be:
You then decide to do a code-first deployment: instead of making changes via the portal & extracting, you want to change the git artifacts and publish that commit. In this change, you remove API A from the managed gateway, add a new API C to the self-hosted gateway, and add a new API D that won't be associated with any gateways. Your folder should look like this:
The publisher will detect the following changes and make them accordingly when it runs:
Does that make sense? Let me know if I'm missing something. |
Something just clicked for me; I misread your initial question. When you talk about the "managed" gateway, you're not referring to a gateway you create called "managed". You're referring to the built-in managed gateway. If that's the case, I doubt there's functionality to manage that "managed" gateway. You can't export it as an artifact and "manage" it. You can assign APIs to a self-hosted gateway using the methods described in the previous comment, but I'm not aware of a way to also disassociate them explicitly from the built-in gateway. I would suggest creating a support ticket and asking whether that's possible (outside of our tools). If they show you how to do it, we can see if the steps are achievable through our tools. |
Yes, I am talking about the built-in managed gateway. Sorry for the missing clarity. I actually experimented and simply created a folder called "Managed" and added an apis.json that has an empty array in it. |
Can you elaborate on what you're seeing? How do you know they're no longer associated with the built-in gateway? |
Thanks for the information - makes sense now. I think our implementation will partially handle your scenario. When the extractor runs, it queries APIM for a list of gateways. It then loops through all gateways and exports their associated APIs. The problem is that APIM's list of gateways does not include the managed gateway. We would have to add a step to explicitly ask for the managed gateway's APIs. The APIs would then show up in Adding to our backlog for further investigation. |
@daviian feel to submit a PR and we can merge accordingly. |
I suppose this also needs to be done in the publisher? Otherwise the built-in managed gateway is always assigned automatically. |
@guythetechie - I've had a look into it and locally it looks good so far. However, there is one point I have concerns about. What are your thoughts on this? If you like I can create the PR so that you can have a preliminary look as well. EDIT: |
@guythetechie @waelkdouh Any update? Anything I can do/provide to help out and create some progress? |
Release version
v5.1.1
Question Details
Our APIM solely uses self-hosted gateways and thus does not require every API to be assigned to the "Managed" gateway.
However, even though the API is only assigned to a specific self-hosted gateway, the "Managed" gateway is still getting assigned to it.
I added a "Managed" gateway into the
gateways
directory and set the APIs to an empty array.However, this only works when not using the commit id during publishing, as the Managed gateway file is not changed when I add a new API.
How is this supposed to be handled?
Expected behavior
"Managed" gateway is not assigned whenever I assign it to some custom gateways.
Actual behavior
"Managed" gateway is always assigned to new APIs.
Reproduction Steps
Create a fresh API and assign it to a custom gateway (not the "Managed" one)
Folder structure:
Content of
gateways/self-hosted/apis.json
Content of
gateways/Managed/apis.json
Since the
gateways/Managed/apis.json
has not been touched/changed during the commit, the publisher does not update the Managed gateway assignment, so the new API is actually having both the "Managed" and "self-hosted" gateways assigned to it.The text was updated successfully, but these errors were encountered: