ZiBaT => Peter Levinsky => Programming => exercise

SOAP+Database
Azure
- part5

Updated : 2016-09-26

Exercise: SOAP and DataBase in Azure - Part 5

Mission:

To understand and use the MicroSoft cloud solution Azure.

Precondition:

The exercise Create you own SOAP-service part3
and Create you own SOAP-service part4


Exercise A: Make Azure ready

Create an azure account (you get a code from the teacher) see Create an account on Microsoft Azure

Install the Azure SDK for visual studio see : https://azure.microsoft.com/da-dk/downloads/ ( .Net -> VS2015 ) can take some time

Exercise B: Create two service in the cloud (in Azure)

You only have some amount of money so a good advise is to predefine a database and a webservice in the cloud.

Exercise B1: Make a database

Go to the azure http://portal.azure.com

Create a new SQL-database (you will create a server + a database) - Remember your PASSWORD for the database server

To create a database you need a ressource-group for telling where your database server should be hosted - it could be north europe

Exercise B2: Make a webservice

Create a web-service - again you need to tell a ressource group - it can be the same as for the database.

 

Now you can use or reuse these two services

 

Exercise C: Create a table for the Sensor data

In Visual studio - open server explorer - click on the cloud -> SQL databases.

For your database right click and open in SQL-server object browser.

Now you can do as if your database was located on localhost.

I.E. do as in web service part 4 exercise A

In your SQL object browser create a new database e.g. 'SensorDB'.

Create a table to hold Sensor Data i.e. (light, temperature, timestamp).

Add some data rows (i.e right click on table and pick view data, then you can add data)

You can find your connection string like before by open the properties OR you can see the connectionstring in the azure -> your database

 

Exercise D: Create SOAP service

Like in web service part 4 exercise B

Create the soap service (see web service part 3 exercise A)

When you far implemented the service you are to publish it in the azure.

Pick your predefined web service -> publish.

You can access your service by <<your-webservice-name>>.azurewebsites.net/service1.svc

Now you can use it as all other soap services you have done - But to put it in WcfTestClient you need to start that program 'by hand'.