BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure...

24
BIT 285: (Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett

Transcript of BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure...

Page 1: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

BIT 285: (Web) Application Programming

Lecture 15: Tuesday, February 24, 2015

Microsoft Azure

Instructor: Craig Duckett

Page 2: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

2

Assignment 2: Database is due NEXT Tuesday, March 3rd (zipped and uploaded to StudentTracker by midnight)

Next Lecture 16, Thursday, February 26th, is also Assignment 2 Work Day(no lecture, but time to work on or complete Assignment 2 before submitting)

Assignment 3: REST Framework is due on Tuesday, March 17th Final Exam is on Tuesday, March 17th

Another Recommended Site: http://asp.net-informations.com/

Page 3: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

3

Forcing your Start Page with Web.configSometimes Azure does not recognize your start page even though you defined it in Visual Studio's Solution Explorer. By adding the following code to the Web.config file you can tell your program what the start page will be. Just rename the value to the name you your start page

<system.webServer> <defaultDocument> <files> <clear /> <add value="Login.aspx" /> </files> </defaultDocument> </system.webServer>

Page 4: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

4

What is Microsoft Azure ?

http://azure.microsoft.com/en-us/overview/what-is-azure/

What is Azure? In short, it’s Microsoft’s cloud platform: a growing collection of integrated services—compute, storage, data, networking, and app.

Azure provides both infrastructure-as-a-service (IaaS) and platform-as-a-service (PaaS).

Azure supports any operating system, language, tool, and framework— from Windows to Linux, SQL Server to Oracle, C# to Java. It puts the best of Windows and Linux ecosystems at your fingertips, so you can build great applications and services that work with every device.

With Azure you can build and deploy a wide variety of modern applications for Android, iOS, and Windows that take full advantage of the cloud—including web, mobile, media and line-of-business solutions. Automatically scale up and down to meet any need.

Page 5: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

5

Microsoft Azure: Account Setup and Pre-Requisites

IMPORTANT!

In order to get Microsoft Azure to play nice with other Microsoft applications that you already have installed (e.g., Visual Studio, SQL Server, etc.) there are a number of steps and pre-requisites that must be completed first, or you may find yourself having a difficult time of it, so it is recommended that you use a version of Visual Studio 2013 (the free Community version is perfectly okay, as well as Pro, Ultimate, Developer, Premium, etc.)

If you are using Visual Studio 2012, then you will have to install the Azure SDK. A compact version installs with Visual Studio 2013, so if you want additional Azure Tools you could also download and install it.

Page 6: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

6

The Microsoft Azure Pass Codes

http://www.microsoftazurepass.com

If you have not already done so, you will need an Azure Pass code from your instructor so you can sign-up for your full free 180-day Azure account. Once you have your code, sign up using the link below.

Page 7: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

7

Microsoft Azure

Recommended Training: Videos, Slide Presentations, Assessments (MVA)

Microsoft Azures Fundamentals: Websites (Lessons 1-9, 4 Hours)http://www.microsoftvirtualacademy.com/training-courses/microsoft-azure-fundamentals-websitesLesson 3: How Do I Create and Deploy a Simple Azure Website from Visual Studio is a good place to start

Page 8: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

8

Getting Started with ASP.NET and Azure

Page 9: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

9

Getting Started with ASP.NET and AzureWALK THROUGH

1. Download lec15test.zip from the BIT285 Lecture 15 tab and unzip to a folder.

2. Open in Visual Studio.

3. Explorer, examine, test the simple program. Add a user. Edit a user. Delete a user.

4. If you have not already done so, set up your Azure account with the pass code provided by your instructor via email. If you don't have your pass code, see your instructor and he will provide it for you.We'll look at this now.

5. Right-click on the lec15test project and select Publish Web Site

Page 10: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

10

Getting Started with ASP.NET and Azure6. When the Publish Web window pops up, select Windows Azure Web Sites

Page 11: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

11

Getting Started with ASP.NET and Azure7. When the Select Existing Web Site window pops up, select Sign In… then enter your email address and

click Continue

Page 12: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

12

Getting Started with ASP.NET and Azure8. After the redirection screen, at the Sign In window enter your account password and click Sign In

Page 13: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

13

Getting Started with ASP.NET and Azure9. At the Selecting Existing Web Site window again, select the New Button (if already have Azure web sites

set up, you can select the from the Existing Web Sites drop down list).

Page 14: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

14

Getting Started with ASP.NET and Azure10. At the Create site on Windows Azure window, do the following:

• give your site a name (e.g., lec15test)

• Select a region

• Create a new database server

• Create a database username (write it down now!)

• Create a database password (write it down now!)

• Select Create button

Page 15: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

15

Getting Started with ASP.NET and Azure11. In the Publish Web Connection screen, select Validate Coonection; when the site is validated (a green

checkmark is displayed) select Settings from the right-hand columv.

Page 16: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

16

Getting Started with ASP.NET and Azure12. In the Settings window, check the Update database checkbox and then the Next button.

Page 17: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

17

Getting Started with ASP.NET and Azure13. In the Preview window, select Start preview to preview your project files (this may fail once or twice,

just select it again).

14. Select Preview Database to preview the database, then Close to return to Publish window, then select Publish key.

Page 18: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

18

Getting Started with ASP.NET and Azure15. After the site is built and published to Azure (this may take a moment or two) it will open it in the

browser. Test your site to make sure everything works as planned. It may default to a different page than you had intended—this can be 'fixed' later—so manually enter a page name to test (e.g., Login.aspx).

Page 19: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

19

Getting Started with ASP.NET and Azure13. Login to Azure at https://manage.windowsazure.com and check your listed web site in the WEBSITES

section, and check your database in the SQL DATABASES section (I already have other websites and database being hosted in Azure, so the screen caps below show multiple).

Page 20: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

20

Getting Started with ASP.NET and Azure14. Under Websites, click on your website to display the Dashboard page and explore the various features.

Page 21: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

21

Getting Started with ASP.NET and Azure15. To allow a website database to be a accessed through a browser, you will need add an ip address (or

range of ip addresses). Do this by selecting your database in SQL DATABASES, then DASHBOARD, then Manage Allowed IP Addresses.

Page 22: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

22

Suggested Links of Interest

• Getting Started with Azure Websites and ASP.NET

• Microsoft Azure Training Courses (Microsoft Virtual Academy)

• Azure SQL Database Firewall

• How to Configure Firewall Settings in Azure / SQL Server

• Azure SQL Database Connectivity Troubleshooting Guide

• Azure Websites Cheat Sheet

Page 23: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

23

Forcing your Start Page with Web.configSometimes Azure does not recognize your start page even though you defined it in Visual Studio's Solution Explorer. By adding the following code to the Web.config file you can tell your program what the start page will be. Just rename the value to the name you your start page

<system.webServer> <defaultDocument> <files> <clear /> <add value="Login.aspx" /> </files> </defaultDocument> </system.webServer>

Page 24: BIT 285: ( Web) Application Programming Lecture 15: Tuesday, February 24, 2015 Microsoft Azure Instructor: Craig Duckett.

24

Lecture 15: In-Class ExerciseFrom the menu bar, select Lectures and go to the Lectures 15 bar and select Lecture 15 ICE to begin working on today's in-class exercises.