Best way to copy Ignition Data to Microsoft Azure w/ REST API

Are there any applications to aid in copying data to an Microsoft Azure database using an REST API?

Not at all sure how this would work but basically looking to create a redundant historical database in Microsoft Azure. We currently do not need to send any data to Ignition. Ignition would just be sending data to the Microsoft Azure database with a time stamp and a username and password and or token/API Key for authentication.

Wondering if there is there is a way to simply duplicate any existing historical data collection and pass it to the Microsoft Azure database at the same time or if there would be a separate app or while-running script to read real-time data or historical data and send it along?

Would we be better off with something like Sepasoft’s Web Services module?

Seems like some info here may apply: Web API Scripting Help

It worked pretty well for me. I was able to use it with success.

Any details you could share would be greatly appreciated. Did you end up using httpClient? And you were writing out to a REST API? Where did you end up putting the script and how are you triggering it?

There was a link to an Ignition Exchange Module to work with WebDev but it just goes to a blank page now. Just trying to figure out the best way to go about this.

I'll get the example today and throw it on here.

1 Like

That would be great, thanks so much.

This is an example of a "patch" to put data into the REST api
You could probably make it fancy and loop through a list or something to write a lot at once

variable1target = target
variable2data = targetdata

client = system.net.httpClient()

requests = client.patch(url="linktext.com/variable1target),
username="username", password="password",
data={"targetdatafield":"{}".format(variable2data)})

print requests.json

================

This is how i read the data out of the api and also verified data just written

client = system.net.httpClient()

variable1target = target

requests = client.get(url="*linktext.com/variable1target",
username="username", password="password")

print requests.json

I think in the end I pulled data from a db table, formated it into a list or dictinary and looped through it to write to an api. I kept the username and password in Ignition tags, i think.

1 Like