SQL Azure export Data to FTP site - c#

I have an Azure hosted (web-forms) asp.net website, using Azure SQL for the database.
I need to setup an automatic transfer of some of the data nightly to a specific FTP site. The data will be in CSV format... so just a basic query, CSV file created, and the file sent via FTP.
My first inclination would be to just create a specific web-page which does the query, creates the file, and sends it out (all in code) - and then schedule this using Azure Scheduler Jobs Collection.... but I'm just wondering if there would be another "best practice" method for doing this such as Azure Data Factory, connectors, etc?
Just wanted to get some input on what road to go down. Any help would be appreciated.
Thank you.

My first inclination would be to just create a specific web-page which does the query, creates the file, and sends it out (all in code) - and then schedule this using Azure Scheduler Jobs Collection.... but I'm just wondering if there would be another "best practice" method for doing this such as Azure Data Factory, connectors, etc?
Firstly, as you mentioned, you can run a job/task on schedule (Azure Scheduler, Azure WebJobs or Azure Functions can help you achieve it) to request that specific web-page to transfer data from Azure SQL database to FTP server.
Secondly, Azure Logic Apps enable us to use SQL Database connector and FTP connector to access/manage SQL Database and FTP server, you can try to use it. And this SO thread discussed transferring data from SQL database to FTP server using Azure Logic Apps, you can refer to it.

Related

Azure Database backup to Local Storage

I build a web program and hosted it on an Azure Virtual Machine. I'm using the database as Azure Database.
This is the first time I hosted a web application all by programing and finalization and did it by self-studies.
So I want to know when I test it on a local server I used to run a scheduled script that took a daily backup of my database. But when I hosted it on the Azure Database, I couldn't find a way to get a backup of my database. ( It has an option but I have to buy another storage to create a backup. So it costs a additional fee)
Is there any way to get a database backup without paying the additional cost? I can connect to the database using the credentials in my local SQL server. I tried right-clicking the database name and tried to get a backup but the option wasn't there. Then I tried to get it by generating scripts and selecting the option, data, and schema. It fails to take the all data it currently has.
Want to know how you guys doing this. And another thing, The reason why I used a Virtual machine to host my web application and used Azure database as the database is, that I tried installing the SQL Server on the Virtual machine. But from the application, I couldn't connect to the created server on the VM. Followed a few tutorials but couldn't figure it out. So if anyone knows how to do it, please help me to solve it because then I can re-write the auto backup script and get the backup on the VM.
Waiting for a better solution from the experts.
Is there any way to get a database backup without paying the additional cost?
You can Export the database to a BACPAC file

Do I have to install sql server on each client to use my disk top application?

I have a disk top application made by c# visual studio. My question is do I have to setup SQL server on each client to use my application? or there is another way to attach my database with my application and compress it as one and send to each client and those just extract that file and use the application correctly?
On a real scenario, your database should be placed on a remote server and the clients should only access the database through your API (that will need to support authentication or any other identity based systems).
If your application only needs to store some local information (relevant only for your client app), then you can just use LocalDB or AppSettings, depending on your data structure.
Otherwise, if your application contains more complex features, then you will need an API and a remote DB managed only by you.
To conclude, you only need to setup Sql Server once, when you want to create the design of it (tables, columns, links). The clients will only have to connect to it and pull their data. And this task can be done without installing SqlServer. This link shows you that you only need System. Data assembly to connect to a Sql Server DB.
Yes you need to instal SQL server on each machine or if you go for LocalDB then also u need to instal SQL server engine ,and you have a better option u need to buy sqlserver from AZURE (it's free for one month try if want click here AZURE)

Implementation of SQL Data Export Service in c#

I'm new to Azure, I want to know about how we can implement SQL Data Export Service in c#.
my actual problem is "I am using C#.net to implement some web services and also use SQL azure as database for that services. So there each day i want to check whether there is any updation in my database. If there is an updation then i want to read only that updated data from my sql azure database and load that datainto some another sql database(both SQL Server and SQL Azure)". So i want to implement this function as windows azure worker role. So each and every day these worker role be executed. How i can implement that entire operation using c#.net.
If anyone know the solution please help me. Thanks
For that you will have to create a "Worker Role", which is similar to a window service.
For details have a look at
How to create a worker role
and also
Building Windows Azure Service: Worker Role Background Tasks Handler

How to deal with files on server Silverlight

I would to have the ability to connect to a SQLite database file, I am using a C# SQLite Library but due to Silverlight's permissions I can not make a connection to actually locate the file, Can anybody help with actually using the file to execute queries on to?
Thanks.
SQLite is an embedded database which means that only the process hosting it can use it and run queries against it. If you want to connect to a database on the server, you have to expose it through a service (SOAP, WCF, WCF RIA Services) or a REST endpoint.
Using SQLite with Silverlight only makes sense if you want to store files locally.

Accessing remote MySQL data using c#

I work on a Joomla web site, installed on a MySQL database and running on IIS7. It's all working fine.
I now need to add functionality that lets (Joomla-)registered users change some configuration data. Though I haven't done this yet, it looks straightforward enough to do with Joomla. The data is private so all external access will be done through HTTPS.
I also need an existing c# program, running on another machine, to read that configuration data. Sure enough, this data access needs to be as fast as possible. The data will be small (and filtered by query), but the latency should be kept to a minimum. A short-term, client-side cache (less than a minute, in case a user updates his configuration data) seems like a good idea.
I have done practically zero database/asp programming so far, so what's the best way of doing that last step? Should the c# program access the database 'directly' (using what? LINQ?) or setup some sort of Facade (SOAP?) service? If a service should be used, should it be done through Joomla or with ASP on IIS?
Thanks
I ended up using a WCF service façade written in c# that returns the data from the database. The service only exposes a couple of functions that query parameters as arguments. The SQL queries are not exposed, nor is the database connection string. The WCF service uses the mysql connector/net 6.3.1 to talk to mysql. The WCF service is accessible only over https, and requires a username & password.

Categories