1

Like this topic : https://stackoverflow.com/questions/32843290/implementing-iot-powerbi-table-schema/32844087#32844087, I would like to retrieve data from an API REST to create a dashboard which will refresh in real time the data taken from the API.

In order to do that, I have to go through Azure Events Hubs to get the data taken from the API. I have troubles dealing with how to retrieve the data from the API to put it in the entry point of Azure Events Hub. I know I have to write a program (preferably by using Visual Studio) and make this program retrieve the data from the API and put it in the Event Hub but I have difficulties to see how I should begin. What kind of program and what I would need.

I tried to find some tutorial/codes about this but couldn't find anything about retrieving from external API.

From what I can understand, I need to write a program that connects to the Events Hub (not difficult), retrieve the data of the API, store it in a variable created and send it to Events Hub. I would like a bit help on how to start, where to start, what classes for example I would need etc...

I am not an expert on API at all, but I have some knowledge. For information this is the website from which I am trying to retrieve data from : https://data.sncf.com/api/en. The use of the API allows us to retrieve information in a json format if I am correct and I will have to save this data to store it in a variable ?

Thank you.

Community
  • 1
  • 1
Robby
  • 11
  • 3
  • @ Robby,Would you like to show your data using PBI or website which you created? – Will Shao - MSFT Nov 30 '16 at 05:59
  • @WillShao-MSFT I want to show my data using PBI. But I am a bit confused. Now I have created a class libraries with a scrapper, a workerrole and I am a bit lost on how to make a main, an executable to run the program... – Robby Dec 01 '16 at 14:34

1 Answers1

1

Per my understanding, I assumed that you could try to follow the steps below to achieve your purpose.

1.Use Azure WebJobs to call your API periodically, then send the data retrieved from the API to Azure EventHub;

You could follow this tutorial for getting started with WebJob by using VS. Also, you could follow this thread for making calls to a REST API via C#. For a simple way, you could leverage EventHub bindings supported by azure-webjobs-sdk to send messages to an event hub after you retrieved data from REST API.

2.For your client-side, you could follow the official tutorial to receive messages from EventHub via EventProcessorHost.

Community
  • 1
  • 1
Bruce Chen
  • 18,207
  • 2
  • 21
  • 35