An Azure service that provides a hybrid, multi-cloud management platform for APIs.
Hi @curious7 -
On the Try me button, you probably don't need custom development for this. The developer portal has visibility controls built in, and you can apply them at two levels.
Product level (simplest). Azure portal → your API Management instance → APIs → Products → select the product → Access control → + Add group. The groups listed there are the ones that can see the product and its APIs.
Guests is the built-in group for unauthenticated visitors. The portal only tells you its membership is system-managed, but the groups doc defines it as everyone who hasn't signed in. If Guests isn't in that list, unauthenticated visitors never reach the API page at all, so the Try me button isn't reachable for them. If it is listed and you don't want that, delete it. Full steps are in this section of the groups doc.
Page or section level. Open the developer portal admin interface (Developer portal → Portal overview → Developer portal). Select the section containing the test console and click the Change access icon, then restrict it to your signed-in groups. The same works per page — gear icon next to the page name on the Pages tab, then Access. Screenshots of both are in this section of the developer portal overview.
Use View as in the top menu to preview the portal as a Guest before you commit, then Publish.
One thing though, this only works on the managed portal, not a self-hosted one.