Relational databases, and more … Azure storage Relational databases, and more … Azure storage
Azure storage possibilities Azure offers several storage possibilities Relational databases Microsoft SQL Server database MySQL database Document databases Azure Document DB: NoSQL database MongoDB Storage BLOB: Binary Large OBjects Tables Queues: Intended for communication between services Files Azure storage
Azure: Using SQL Server database In Azure portal make an SQL Server database Be patient … When created …. Press the ”Open in Visual Studio” button SQL Server uses TCP port 1443. At home: Open this port in your firewall At school: Use the network EGV5-DMU Not necessary any more: Port 1443 should be open i the schools network Create tables etc in Visual Studio and Press the ”Update” button to deploy your table to Azure Azure storage
Create database Cloud Explorer (Top-Left corner) SQL Databases Your database General database advices Id primary key identity Identity: The database will generate the values String-like type Nvarchar(max_length) N means Unicode Var means varying length If you need timestamps Datetime default getDate() Azure storage
Work from Visual Studio Port 1443 must be open for access Write some T-SQL Press the “Update” button to update the database structure Top-left corner of the SQL design pane Generates a script (with the changes) and executes the changes Take a little while Azure storage
Connection string To connect to the cloud database from an application, you need a connection string. The connection string for your cloud database can be found i Azure portal The connection string include your database name + password The connection string can be saved in your C# code file Or in the App.config file (console app) Or in Web.config (WCF provider) Azure storage
Web service as front-end to databases Using the database causes port problems Port 1443 must be open Usually not open in firewalls Solution: Put a web service between the application and the database The web service runs on port 80 Usually open in firewalls Azure storage
Storage as back-end to web services Web services are stateless Storage can be used as a back-end to web services Azure storage