Exercise - Test Cognitive Services on the IoT Edge device
You'll make an HTTP call to the Azure IoT Edge device that has the Azure Cognitive Services container running. The container provides REST-based query prediction endpoint APIs. Use the host, http://<<your-ipaddress>>:5000
, for container APIs.
Open port 5000 of the edge device.
Go to the edge device you created.
Go to the VM details, then Settings > Networking.
Navigate to Inbound port rules to add an inbound security rule to open port 5000.
Click the Add inbound port rule button
Set the Destination Port Ranges to 5000
Set the Name to Port_5000
Click the Add button
Copy the public IP address of your edge device.
Query the Cognitive Services container running on your IoT Edge device from any browser
Request URL | Purpose |
---|---|
http://<<your-ipaddress>>:5000/ |
The container provides a home page. |
http://<<your-ipaddress>>:5000/status |
Requested with an HTTP GET, to validate that the container is running without causing an endpoint query. |
http://<<your-ipaddress>>:5000/swagger |
The container provides a full set of documentation for the endpoints and a Try it out feature. |
- Open the browser, and replace the IP address of edge device with
<<your-ipaddress>>
. - Go to
http://<<your-ipaddress>>:5000
. - Select API Description or go to
http://<<your-ipaddress>>:5000/swagger
to get a detailed description of the API. - Select Try it out and then Execute. You can change the input value as you like. The result will show up farther down on the page.
Need help? See our troubleshooting guide or provide specific feedback by reporting an issue.