Azure APIM gateways and Bicep
Is it possible to create an api with Bicep or ARM Template that doesn't have the default gateway 'Managed'?
Azure API Management
-
bharathn-msft 5,101 Reputation points • Microsoft Employee
2021-11-19T04:57:06.29+00:00 @Anonymous Our sincere apologies for delay in getting back to this thread.
Managed gateway seems to be added by default, for the scenario you are looking the possible way might be to create the API and remove a particular API from default gateway within the ARM template .
- Create API or Update API
- Remove API from Gateway (using depends on)
I am further testing this out, will share more details accordingly.
-
Jonas Anker Rasmussen 1 Reputation point
2022-07-06T20:20:23.767+00:00 @bharathn-msft Did your investigation provide further insights?
From my own testing, I experience similar as raised by @Anonymous . By default, the
Managed
gateway is associated with an API. In the Management Plane UI, it is possible to remove theManaged
gateway from an API. However, I am unable to find any Bicep/Arm support for removing the default Managed gateway association on an API.The Rest API delete and create-or-update explicitly mention that they can not be called for gateway id 'managed'. However, tests show that this is not the case and this is one way to remove the Managed gateway association to an API. It is therefore not clear if the documentation is wrong or the behavior is unintended.
Is this a deliberate limitation on APIM or can you provide official guidance on how to remove the Managed gateway on an API in code?
Br, Jonas
-
bharathn-msft 5,101 Reputation points • Microsoft Employee
2022-07-07T21:16:36.12+00:00 @Jonas Anker Rasmussen My sincere apologies that i couldn't get back to this thread earlier. Let me/my team review this again and get back to you at the earliest.
-
David Schneiderbauer 10 Reputation points
2024-03-29T09:19:06.48+00:00 Is there any update on this question?
I do have a similar situation using https://github.com/Azure/apiops -
David Schneiderbauer 10 Reputation points
2024-04-11T12:39:46.2266667+00:00 @bharathn-msft I am sorry I had to revive this old thread, but it is still relevant even after all the months.
Can you provide some update please? -
Ben Gimblett 4,540 Reputation points • Microsoft Employee
2024-05-17T11:44:03.77+00:00 I believe this field is required as it refers to the host, the default being the Az hosted "managed" gateway. This well have been introduced when it became possible to also host APIs on one or more "self hosted" (containerized) gateway hosts - meaning the same API could then be run on more than one host - as you decide.
What is the reason for wanting to remove the tag?
-
David Schneiderbauer 10 Reputation points
2024-05-21T06:01:24.7966667+00:00 In our situation APIs are provided via self-hosted gateways and should not be exposed via the managed gateway.
The API Gateway Api - Delete can be used to remove an API from the managed gateway, but the documentation states thegatewayId
"Must not have value 'managed'"
So foremost I think an update of the documentation should be fine, unless there is a specific reason this should not be used. -
Ben Gimblett 4,540 Reputation points • Microsoft Employee
2024-05-21T10:15:45.24+00:00 So to summarise (I've not tried to do this) "The API Gateway Api - Delete can be used to remove an API from the managed gateway, but the documentation states the
gatewayId
"Must not have value 'managed'"You're saying that although the doc for the API action (which is likely auto-generated) states that you cant remove an API from the managed gateway , you can in fact do it this way (as this is what you currently do to ensure given APIs can only be requested via your S/H gateways)?
-
David Schneiderbauer 10 Reputation points
2024-05-21T12:05:57.0966667+00:00 Yes, exactly.
This endpoint is also used from within the APIM Portal when you remove the "Managed" tag from the Gateways input field.
-
Ben Gimblett 4,540 Reputation points • Microsoft Employee
2024-05-21T12:09:55.8533333+00:00 Thank you. I will bring this to the attention of the APIM content writer.
Sign in to comment