0% found this document useful (0 votes)
63 views

Create An Enterprise Web Application

In this lab, you will create an Azure Website and SQL Database. You will then configure the tables and Azure AD Application settings for the application.

Uploaded by

ed.collio
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
63 views

Create An Enterprise Web Application

In this lab, you will create an Azure Website and SQL Database. You will then configure the tables and Azure AD Application settings for the application.

Uploaded by

ed.collio
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Create an

Enterprise Web
Application

Contents

Create and Configure Azure Resources......3


Configure the SQL Database......................6
Create Azure AD Applications...................11
Deploy to Azure Websites........................14
Terms of use.............................................17

Create and
Configure
Azure
Resources

Estimated time to complete lab is 30 minutes.


Overview
In this lab, you will create an Azure Website and SQL Database.
You will then configure the tables and Azure AD Application
settings for the application.
Open the sample solution
1. Using Visual Studio 2013 click on File, Open Project, then
Navigate to the Samples\Events subfolder within the
student folder and then select Events.sln.
Create the website and SQL Database for the application
1 Using a new tab or instance of your browser navigate to the
preview portal http://portal.azure.com.
1

If prompted to login use the organization account created


for your Active Directory tenant.

Click on New, Everything, Website + SQL, then Create

Specify the name of the resource group as EventsAppRG.

Azure Data Services Training

Click on WEBSITE -> Configure Required Settings

Specify a unique URL.


Specify the LOCATION (this should be the same location as
you picked in the initial setup script).
Create a new Web Hosting Plan using the S1 STANDARD
tier named MyStandardPlan.

Click on DATABASE -> Configure Required Settings

Name the Database: EventsDB


Change the PRICING TIER to P1 PREMIUM

Click on SERVER
Specify a unique server name
USERNAME: demouser
Password: demo@pass1
Location: Should be the same region as your website.

Azure Data Services Training

Click the Create button to create the resources.

Update the connection string in the web.config for local testing.


1 Within the EventsAppRG resource group, click the
EventsDB database.

Click the Properties tile.

Click Show database connection strings.

Copy the ADO.NET connection string.

10 Within Visual Studio open the web.config and replace the


value for the DefaultConnection connection string with the
copied value. Ensure to update the {your_password_here}
placeholder with the password (demo@pass1) set earlier.

11 In the portal, within the EventsAppRG resource group, click


the link for the Azure Website created earlier.
Azure Data Services Training

12 Click Settings, Application Settings, and then


Connection Strings. Add a new Connection string named
DefaultConnection and paste in the connection string.
Ensure to update the {your_password_here} placeholder
with the password (demo@pass1) set earlier.

13 Click the SAVE button at the top of the page.

Configure
the SQL
Database

Configure the SQL Database Firewall


1 Using the Azure management portal
(https://portal.azure.com) click on the EventsAppRG
resource group database from the Start board.

14 Click on the SQL database icon in the summary, and then


click on the SQL server instance.
15 Click Firewall Settings

16 For the lab, specify 0.0.0.0 for the START IP and


255.255.255.255 for the END IP. This is for local
development. In a real world deployment, this would be
restricted to known IP addresses.
Click SAVE when complete and close the Firewall Settings
blade and the SQL Server blade.

Create the Events application tables


Azure Data Services Training

In the EventsAppRG resource group, open the EventsDB SQL


Database.

17 In the toolbar, click the Open in Visual Studio button.

18 Click the open in Visual Studio button and confirm the


prompt to open the database.
19 On the SQL connection dialog open click the Connection
Properties tab. Set the Connection time-out and Execution
time-out to 360 seconds and then click Connect.

20 Expand the EventsDB database, then right click on Tables,


then click Add New Table menu item.

Azure Data Services Training

21 Change the name of the table to Event by modifying the


TSQL [Table].

22 Using the table designer add the following columns.


Title, nvarchar(100), Allow nulls = unchecked
Description, nvarchar(250), Allow Nulls =
unchecked
Location, nvarchar(100), Allow Nulls = unchecked
StartDate, datetime, Allow Nulls = unchecked
Days, int, Allow Nulls = unchecked
AudienceId, tinyint, Allow Nulls = unchecked
OwnerId, nvarchar(250), Allow Nulls = unchecked

23 Right click on the Id column and select properties.


24 In the properties pane set the (Is Identity) property to True.

Azure Data Services Training

25 Click the Update button to generate the create script.


26 Click Update Database to create the new table.

27 Add another table to the database named Registration.

Azure Data Services Training

28 Specify the following columns and types.

UserId, nvarchar(100), Allow Nulls = unchecked

EventId, int, Allow Nulls = unchecked

RegistrationDate,. Datetime, Allow Nulls = unchecked

HasAttended, bit, Allow Nulls = unchecked

29 In the T-SQL window replace the default constraint with the


following:
CONSTRAINT [PK_Registration] PRIMARY KEY CLUSTERED
(
[UserId] ASC,
[EventId] ASC
)

Azure Data Services Training

30 Click the Update button to generate the script.


31 Click the Update Database button to create the database.
Populate with Example Data
1 Using Visual Studio 2013 open the EventsData.sql file
located in the student folder.
32 Click the Execute button and when prompted enter the
database credentials.

Create
Azure AD
Application
s

Create app for the local environment


1 In the Current Azure Management Portal, open the AD
Tenant and click Applications.

33 Click Add an Application.

34 Click Add an application my organization is


developing.

35 Name the application Events and click the Next arrow.

Azure Data Services Training

36 Specify the following properties for your application.


SIGN-ON URL: https://localhost:44309
APP ID URL: https://[YOUR TENANANT
NAME].onmicrosoft.com/Events

Click the checkmark to create the application.


Update the Sample Application for AD Access
1 Click the CONFIGURE button of the new application.

37 Under permissions to other applications, check the box by


Read directory data and click save at the bottom.

38 Open the web.config of the Events sample application.

Azure Data Services Training

39 Copy the value of the Client ID value in the Events


application to the ida:ClientID app setting.

40 Copy the value of APP ID URI from the Events application to


the ida:Realm and ida:AudienceUri app settings.

Replace the placeholder value within the <audienceUris>


element as well.

41 Under keys, change the drop down to 1 year and click


SAVE at the bottom of the page.

Update the value of the ida:Password app setting with the new
value.

42 Click VIEW ENDPOINTS

Copy the value from FEDERATION METADATA DOCUMENT

To the ida:FederationMetadataLocation app setting.

43 Update the [Tenant Name] placeholders by replacing them


with your Active Directory tenant name. For example,
TrainingAD is the AD Tenant in this lab screenshots.

Validate you can login


1 Right click on the project and select View in Browser

Azure Data Services Training

44 Login to the site using the following credentials:


User: bjones@[Tenant Name].onmicrosoft.com
Password: demo@pass1

Deploy to
Azure
Websites

Publish the Application to Azure Websites


1 Using Visual Studio 2013 right click on the Events project
and select Publish.

2 Click Microsoft Azure Websites

If not signed in, click Sign In and enter the global admin
credentials for your Active Directory tenant.

Select the website from the Existing Websites dropdown


and click OK.

Azure Data Services Training

Click Publish on the next screen to publish the website.


The publishing process will automatically create a new
application in Azure AD for your Azure Website.

Update the Application Settings for the Azure AD Tenant


1 Open the current Azure management portal
(https://manage.windowsazure.com) and click on Active
Directory, then open your Active Directory Tenant.
45 Click on Applications

46 Open the Application for the Azure Website by clicking its


name.

47 Click on CONFIGURE to view the configuration settings.

48 Open another tab in your browser (keep both open), open


the web site in the Azure Portal (https://portal.azure.com)
and click on Settings, and then Application Settings.

49 Add the following App Settings to the website settings


from the Azure AD Application Configuration page.
Name: ida:Realm

Value: APP ID URI

Name: ida:AudienceUri

Value: APP ID URI

Name: ida:ClientID

Value: CLIENT ID

Azure Data Services Training

Name: ida:Password

Value: KEY

50 For the ida:Password value, in the tab with the Azure AD


Application you will need to create a new KEY by selecting
the duration from the drop down and clicking save. The key
will then be displayed and you can copy it into the
ida:Password value.

51 Click the SAVE button at the top of the page when complete
to save the settings.

2014 Microsoft Corporation. All rights reserved.

Terms of
use

By using this Hands-on Lab, you agree to the following terms:


The technology/functionality described in this Hands-on Lab is
provided by Microsoft Corporation in a sandbox testing
environment for purposes of obtaining your feedback and to
provide you with a learning experience. You may only use the
Hands-on Lab to evaluate such technology features and
functionality and provide feedback to Microsoft. You may not
use it for any other purpose. You may not modify, copy,
distribute, transmit, display, perform, reproduce, publish,
license, create derivative works from, transfer, or sell this
Hands-on Lab or any portion thereof.
COPYING OR REPRODUCTION OF THE HANDS-ON LAB (OR ANY
PORTION OF IT) TO ANY OTHER SERVER OR LOCATION FOR
FURTHER REPRODUCTION OR REDISTRIBUTION IS EXPRESSLY
PROHIBITED.
THIS HANDS-ONLAB PROVIDES CERTAIN SOFTWARE
TECHNOLOGY/PRODUCT FEATURES AND FUNCTIONALITY,
INCLUDING POTENTIAL NEW FEATURES AND CONCEPTS, IN A
SIMULATED ENVIRONMENT WITHOUT COMPLEX SET-UP OR
INSTALLATION FOR THE PURPOSE DESCRIBED ABOVE. THE
TECHNOLOGY/CONCEPTS REPRESENTED IN THIS HANDS-ON
LAB MAY NOT REPRESENT FULL FEATURE FUNCTIONALITY AND
MAY NOT WORK THE WAY A FINAL VERSION MAY WORK. WE
ALSO MAY NOT RELEASE A FINAL VERSION OF SUCH FEATURES
OR CONCEPTS. YOUR EXPERIENCE WITH USING SUCH
FEATURES AND FUNCITONALITY IN A PHYSICAL ENVIRONMENT
MAY ALSO BE DIFFERENT.
FEEDBACK. If you give feedback about the technology
features, functionality and/or concepts described in this HandsAzure Data Services Training

on Lab to Microsoft, you give to Microsoft, without charge, the


right to use, share and commercialize your feedback in any
way and for any purpose. You also give to third parties, without
charge, any patent rights needed for their products,
technologies and services to use or interface with any specific
parts of a Microsoft software or service that includes the
feedback. You will not give feedback that is subject to a license
that requires Microsoft to license its software or documentation
to third parties because we include your feedback in them.
These rights survive this agreement.
MICROSOFT CORPORATION HEREBY DISCLAIMS ALL
WARRANTIES AND CONDITIONS WITH REGARD TO THE HANDSON LAB , INCLUDING ALL WARRANTIES AND CONDITIONS OF
MERCHANTABILITY, WHETHER EXPRESS, IMPLIED OR
STATUTORY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
NON-INFRINGEMENT. MICROSOFT DOES NOT MAKE ANY
ASSURANCES OR REPRESENTATIONS WITH REGARD TO THE
ACCURACY OF THE RESULTS, OUTPUT THAT DERIVES FROM USE
OF THE VIRTUAL LAB, OR SUITABILITY OF THE INFORMATION
CONTAINED IN THE VIRTUAL LAB FOR ANY PURPOSE.

DISCLAIMER
This lab contains only a portion of new features and
enhancements in Microsoft SQL Server 2014. Some of the
features might change in future releases of the product. In this
lab, you will learn about some, but not all, new features.

Azure Data Services Training

You might also like