question

AmitMadaan-5312 avatar image
0 Votes"
AmitMadaan-5312 asked AnuragSharma-MSFT commented

Storing data using API call in scheduled manner in database/file

I have an API URL that show data if used in postman; and when visited directly in browser it allows to save a csv file on desktop.
I want to call and store the API data daily (auto schedule manner) to a cloud location /drive or database service of Azure.
Sample URL https://api.bseindia.com/BseIndiaAPI/api/HLDownloadCSV/w?scripcode=&HLflag=H&Grpcode=&indexcode=

if someone can help please suggest;
what I am trying to achieve is to store data from the URL on daily basis (once a day on a specific time) with date stamp of data

partner-center-apiazure-api-fhirazure-cyclecloud
· 1
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi @AmitMadaan-5312, please let us know if you need more details on the same. If answer helps, you can choose to mark it 'Accept Answer'

0 Votes 0 ·

1 Answer

AnuragSharma-MSFT avatar image
0 Votes"
AnuragSharma-MSFT answered

Hi @AmitMadaan-5312, welcome to Microsoft Q&A forum.

We can do this activity with Azure Logic Apps.

Firstly we need to create a Storage account where we will store all the csv files. Its very straight forward:

Create a storage account

Then we can create a logic app as mentioned below. It can be scheduled as per our requirements, in below screenshot it is scheduled once a day:

Setting schedule:

141333-image.png


Defining Http action with get method:

141304-image.png

Finally loading the csv file to the storage account we created:

141293-image.png

Once this runs, we can check the container in storage account, it should have the csv file:

141324-image.png


This is one method, another way is through Windows Scheduler as mentioned in below article. But here we need to download the file by writing any custom code.

Windows Scheduler task to backup your data to storage account using AzCopy Utility & SAS token

Please let me know if this helps or else we can discuss further.



Please don't forgot to click on accept it as answer button 141306-image.png wherever the information provided helps you. This can be beneficial to other community members as well.



image.png (22.2 KiB)
image.png (33.8 KiB)
image.png (30.0 KiB)
image.png (50.3 KiB)
image.png (6.0 KiB)
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.