How to trace the Api Proxy requests without using the Test console on API Gateway? - azure-api-management

I would like to trace real-time requests coming to my API Proxy in azure. There is a facility to trace using the Test console on the API Gateway as per the article below.
https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-api-inspector
But I would like to trace the request when clients sending from their applications or when sending requests from POSTMAN.
There is a similar facility in Apigee Edge to enable the trace at runtime.
Does anyone have idea how to trace realtime API Proxy Requests?
Thanks in advance for your help.

You can enable Azure doagnostocs and use Azure monitor.
Check the below for how to and what data will be logged.
Please look at the below
https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-app-insights
https://learn.microsoft.com/en-us/azure/api-management/api-management-howto-use-azure-monitor#diagnostic-logs

Related

Does it possible to save WebSocket gateway with the same route in Azure API Management

We are using Azure API Management where is supporting WebSocket, but we need 2 different endpoint routes for it, because you can`t create route to your API:
http(s)://{base_url} and ws(s)://{base_url},
you must add difference by using suffix, like :
http(s)://{base_url}
ws(s)://{base_url}/{suffix}
or
http(s)://{base_url}/{suffix}
ws(s)://{base_url}
How we can configure same endpoits ?
During the WebSocket passthrough the client application establishes a WebSocket connection with the API Management Gateway
Check for the steps in adding WebSocket API to APIM here.
Make sure we follow below limitations:
WebSocket APIs are not supported yet in the Consumption tier.
WebSocket APIs are not supported yet in the self-hosted gateway.
Azure CLI, PowerShell, and SDK currently do not support management operations of WebSocket APIs
Refer to this SO thread in including two endpoints for same URL in backend, thanks to Hury for great explanation. Though it is for functions app, but the process is similar.

IBM API Connect Test and Monitor giving Invalid Request error

I am trying to use API Connect Test and Monitor tool wherein when I gave a Get request and url and with and without authorization token, I am getting this error:
Error. Invalid Request
When I do it using Postman, I get a proper 200 OK response (with and without authorization token).
I have tried for POST request also. Same works in Postman but not in IBM API Test and Monitor.
The IBM API Test and Monitor tool is a cloud-based service. Hence, it can only be used to query endpoints that are publicly available on the internet.
localhost refers to the user's computer which does not normally expose any TCP ports to the wider internet.
You can, however, use the IBM API Test and Monitor desktop app to query localhost

How to protect the Backend API against calls other than Azure API Management

I have an ASP.NET Core REST API Service hosted on an Azure Web App. I own its source code and I can change it if required.
I am planning to publish REST API Service with Azure API Management.
I am adding Azure AD authentication to the Azure API Management front. So, the API management front is secured. All the steps are is described here.
All good so far. Here is the question (or challange?) :
Considering that my backend REST API Service is hosted on Azure and publicly accessible, how do I protect it against the request calls other than the API Management Calls?
How the backend service knows the identity and AAD group claims of the incoming call and access to its claims?
A link to a code sample or online documentation would be a great help.
Update
While there are some overlaps with the follwoing question:
How to prevent direct access to API hosted in Azure app service
... part of this question is still outstanding:
How the backend service knows the identity and AAD group claims of the incoming call and access to its claims?
You can enable static IP restriction on your WebApp to only allow incoming traffic from the VIP of your APIM Service facing ( keep in mind in some specific scenarios , the VIP may change and will be required to update the whitelist again).
Clients ==> AAD==> VIP APIM Service <==> (VIP APIM allowed) Web App
https://learn.microsoft.com/en-us/azure/app-service/app-service-ip-restrictions

How to test that my Ultralight 2.0 IOT agent receives payload

I am using the Ultralight 2.0 IOT Agent.
Although I can see that the payload, that my gateway sends, is subscribed at a specific topic into the mosquitto MQTT broker, how could I test that the IOTAgent is listening at port 4061 and that it is receiving something from the broker?
I am refering to the IOTAgent-UL which is running on a CentOS 7 VM as a service. I have access to it with REST calls and I also see that the payloads, that my gateway sends, are subscribed into the MQTT broker. How could I pass my payloads from the mosquitto to the IOTAgent and after to the Context Broker?
thanks a lot!
What you are asking for seems to be related with the basic operational workflow of the IOTAgents in general. Thus, I'd recommend you to have a look to the following Step by step guide. It is based in another agent (the one for JSON payloads instead of UL) but most of the procedure is the same, so I think it could be useful.
EDIT: JSON format is documented here. UL format is documented here. Payload format is indepedent of the transport, i.e. is the same no matter if you use HTTP or MQTT.

Creating a http web service in message broker

I need to create a http post request that will put a message in a message queue.So far I am able to do it successfull within the test framework i.e: using the integration node.
My question is how I will be able to test this from a external browser?
Do I need to deploy it in an external server?
Any links or suggestion will be really helpful.
I often use curl for testing webservices deployed to IIB. You can use the "-d" parameter to specify a file containing the POST data and this works well for both HTTP and SOAP.
I don't think browsers are meant to call web services directly, try SOAPUI for testing.
Message Broker Applications need to be deployed on a Broker and Execution Group or Integration Node and Integration Server (after V9).