DPS907 notes – Thu Sep 11

Complete notes for today’s session will be posted soon…

.

Code examples for this semester

Code examples will be published on a public GitHub repository.

GitHub is a hosting service for source code. It offers a web interface to enable easy browsing. It also offers a set of tools and capabilities that enable software developers to publish code, collaborate with others, and improve their productivity and effectiveness.

On this web site, a link to the repository is on the right side of the page, near the top. (For best results, open the link in a new tab or window.)

Beginners can use a web browser to view the source code. You can also click the “Download ZIP” button to get a full and complete copy of all code examples in the repository.

For this course, the code examples will be published weekly, in logically-named folders (e.g. “Week_02”).

During the course’s lifetime, about twenty code examples will be published.

As you have observed, each ASP.NET web app or web service project includes a sizable “packages” folder. In the GitHub code repository, each distinct code example does not include the “packages” folder, as a time-saving measure. Each “packages” folder is about 50MB in size, so twenty code examples would require about 1GB storage. The contents of the “packages” folder does not compress much.

However, a single “packages” folder has been placed at the root of the repository. After you download-and-unzip the repository, simply copy-paste the “packages” folder into any distinct code example’s folder to make it ready for use and learning.

All code examples are designed to be usable and error-free. Each should compile and execute correctly. 

If you have any problems with a code example, please contact your professor. 

.

Microsoft Azure deployment

Before doing the tasks in this section, ensure that you have your Microsoft Account, and have activated your Microsoft Azure subscription by using your Student Pass. Also, make sure that your project is NOT open in Visual Studio.

.

Login to the Azure management portal

Login to the Azure management portal, located at http://manage.windowsazure.com.

Your goal will be to create a “web site” that uses a “database”.

In the lower-left area, click the “New” icon to get started.

CreateWebSiteAndDatabasePanel1Choose Web Site, then Custom Create. Complete the “Create Web Site” dialog:

URL: customname.azurewebsites.net (see below for ‘customname’ instructions)

WEB HOSTING PLAN: The item is pre-selected, so do not change it

DATABASE: Create a new SQL database

DB CONNECTION STRING NAME: DefaultConnection

Note: The ‘customname’ for your first web site should be in this format…

course-code-Seneca-name

Course code is either ‘dps907’ or ‘wsa500’. Seneca name is your Seneca email name/identity. For example, your professor’s is:

dps907pmcintyr

.

An example of your professor’s “Create Web Site” dialog is shown at the right.

.

CreateWebSiteAndDatabasePanel2The next dialog is titled “Specify database settings”. Complete it as suggested below:

NAME: customname (yes, use the same custom name for the database name)

SERVER: New SQL database server

SERVER LOGIN NAME: (something that you can remember – notice the format in the example to the right)

SERVER LOGIN PASSWORD: (whatever you want)

REGION: (leave the default selected; it should match the web server setting)

.

An example of your professor’s “Specify database settings” dialog is shown at the right.

.

After a few minutes, the management program will tell you that the web site and database were created. At this point in time, you could browse the web site. Microsoft Azure configures a start page for the web site. It will be replaced after you deploy your app.

.

Deploy a project

Now, open your project in Visual Studio. In Solution Explorer, right-click your project name, and choose “Publish”.

Choose “Windows Azure Web Sites”. You will be asked to authenticate.

PublishStep1

.

PublishStep1Authenticate

.

In the “Select Existing Web Site” dialog, choose the web site you created above. You will see the “Connection” settings. Click the “Validate Connection” button to ensure that you can continue. If successful, a green-circled check mark will appear beside the button.

PublishStep2

.

Click “Next”.

On the “Settings” settings, in addition to the default selections, check (mark) these boxes also:

  • File Publish Options > “Remove additional files…”
  • DataContext… > “Execute Code First Migrations…”

PublishStep3

.

Click “Next”.

On the “Preview” settings, yes, click the “Start Preview” button. A first-time deployment will have a long list. (An updated deployment in the future will have a shorter list.)

Click the “Publish” button. Visual Studio will show an “Output” window, with messages about the deployment process. At the end – if successful – your default browser will open the web app home page.

.

Today’s topics will include…

Continuation of the example we started during the last class; we will finish it off by inspecting the get-one and add-new use cases

As a result, we’ll discuss GET and POST a bit more, by reading parts of the RFC 2616

This will lead into a discussion of HTTP status codes

And then an introduction to the IHttpActionResult interface

We’ll do a brief review of Entity Framework Code First Migrations

Then enable it, so that we can post our work to Microsoft Azure

.

We’ll go through these topics interactively and iteratively

.

.

.

.

.

.

.

.

.

.

.

.

  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: