Running C# code from online source

I work for a small business and, having just graduated with my associates in programming, it was decided that I would head this new project, rather than bringing in a new person.

I have an IoT solution being developed (outsourced the component design to a friend) where he's dumping telemetry up to an SQL database on Azure.

On my end, I'm writing two big pieces of code (along with a bunch of other stuff). Those being the (first) automated reporting and (eventually) interactive reporting.

Interactive reporting seems simple enough, as I can simply build a web app and Visual Studio will automatically set it up to be hosted in my azure account.

The automated reporting, however, I'm not so sure how to handle. (EDIT: I should note, this should be running daily in the morning. I would be fine with either a solution that keeps it always-on and allows me to trigger when a timestamp is reached OR a solution that simply runs from start to finish when called by the host. Whichever is easier, though I suppose I would prefer the former)

I'm confident in my ability to write the code to access the database, pull down the information and generate a report. And I don't think I'll have too much trouble figuring out how to send that report out (sending via a dedicated email account; I'm sure stack overflow can help me)

I'm not sure how to set that code up though. Normally, I would default to a console application, but I need this to be hosted online somewhere; reports need to happen 7-days a week and we don't leave anything but the heat and alarms on over the weekend.

I don't need (or really even want) it to have it's own web page like Visual Studio sets it up when you create a web app. It just needs to sit silently somewhere where it's always on (or at least is on when it's time to run the reports) and connected to the internet (so it can access the db and email)

What's my best option?

by Pidgey_OP via /r/csharp

Leave a Reply