Search code examples
azureazure-service-fabricazure-sql-database

How do you connect to and manipulate an Azure SQL Database from a Service Fabric Stateless Service


I'm completely new to Azure, and this feels like it should be quite obvious, but I've spent a good couple of days searching for documentation on this and can't find a single example of it being done, even though the documentation suggests it is a standard approach.

Following the documentation, I've created an empty SF project with a stateless service. I want to use it to perform the simple task of scraping a webpage every fortnight or so and storing a few links from it in a table.

I've used the Azure Portal to create an SQL Server, and have created a table and a schema via VS2015's SQL SOE, but how do I get the service to interact with it??


Solution

  • You can use any technology you want. Like in any other .NET project type. There's Entity Framework, or plain ADO.NET. You could use configuration to store your connection string. Also have a look at Actors and Reminders. That could also be a simple technology to run your scheduled task.