20532A ENU TrainerHandbook PDF
20532A ENU TrainerHandbook PDF
20532A ENU TrainerHandbook PDF
20532A
Developing Microsoft Azure™ Solutions
MCT USE ONLY. STUDENT USE PROHIBITED
ii Developing Microsoft Azure™ Solutions
Information in this document, including URL and other Internet Web site references, is subject to change
without notice. Unless otherwise noted, the example companies, organizations, products, domain names,
e-mail addresses, logos, people, places, and events depicted herein are fictitious, and no association with
any real company, organization, product, domain name, e-mail address, logo, person, place or event is
intended or should be inferred. Complying with all applicable copyright laws is the responsibility of the
user. Without limiting the rights under copyright, no part of this document may be reproduced, stored in
or introduced into a retrieval system, or transmitted in any form or by any means (electronic, mechanical,
photocopying, recording, or otherwise), or for any purpose, without the express written permission of
Microsoft Corporation.
Microsoft may have patents, patent applications, trademarks, copyrights, or other intellectual property
rights covering subject matter in this document. Except as expressly provided in any written license
agreement from Microsoft, the furnishing of this document does not give you any license to these
patents, trademarks, copyrights, or other intellectual property.
The names of manufacturers, products, or URLs are provided for informational purposes only and
Microsoft makes no representations and warranties, either expressed, implied, or statutory, regarding
these manufacturers or the use of the products with any Microsoft technologies. The inclusion of a
manufacturer or product does not imply endorsement of Microsoft of the manufacturer or product. Links
may be provided to third party sites. Such sites are not under the control of Microsoft and Microsoft is not
responsible for the contents of any linked site or any link contained in a linked site, or any changes or
updates to such sites. Microsoft is not responsible for webcasting or any other form of transmission
received from any linked site. Microsoft is providing these links to you only as a convenience, and the
inclusion of any link does not imply endorsement of Microsoft of the site or the products contained
therein.
Released: 09/2014
MCT USE ONLY. STUDENT USE PROHIBITED
MICROSOFT LICENSE TERMS
MICROSOFT INSTRUCTOR-LED COURSEWARE
These license terms are an agreement between Microsoft Corporation (or based on where you live, one of its
affiliates) and you. Please read them. They apply to your use of the content accompanying this agreement which
includes the media on which you received it, if any. These license terms also apply to Trainer Content and any
updates and supplements for the Licensed Content unless other terms accompany those items. If so, those terms
apply.
BY ACCESSING, DOWNLOADING OR USING THE LICENSED CONTENT, YOU ACCEPT THESE TERMS.
IF YOU DO NOT ACCEPT THEM, DO NOT ACCESS, DOWNLOAD OR USE THE LICENSED CONTENT.
If you comply with these license terms, you have the rights below for each license you acquire.
1. DEFINITIONS.
a. “Authorized Learning Center” means a Microsoft IT Academy Program Member, Microsoft Learning
Competency Member, or such other entity as Microsoft may designate from time to time.
b. “Authorized Training Session” means the instructor-led training class using Microsoft Instructor-Led
Courseware conducted by a Trainer at or through an Authorized Learning Center.
c. “Classroom Device” means one (1) dedicated, secure computer that an Authorized Learning Center owns
or controls that is located at an Authorized Learning Center’s training facilities that meets or exceeds the
hardware level specified for the particular Microsoft Instructor-Led Courseware.
d. “End User” means an individual who is (i) duly enrolled in and attending an Authorized Training Session
or Private Training Session, (ii) an employee of a MPN Member, or (iii) a Microsoft full-time employee.
e. “Licensed Content” means the content accompanying this agreement which may include the Microsoft
Instructor-Led Courseware or Trainer Content.
f. “Microsoft Certified Trainer” or “MCT” means an individual who is (i) engaged to teach a training session
to End Users on behalf of an Authorized Learning Center or MPN Member, and (ii) currently certified as a
Microsoft Certified Trainer under the Microsoft Certification Program.
g. “Microsoft Instructor-Led Courseware” means the Microsoft-branded instructor-led training course that
educates IT professionals and developers on Microsoft technologies. A Microsoft Instructor-Led
Courseware title may be branded as MOC, Microsoft Dynamics or Microsoft Business Group courseware.
h. “Microsoft IT Academy Program Member” means an active member of the Microsoft IT Academy
Program.
i. “Microsoft Learning Competency Member” means an active member of the Microsoft Partner Network
program in good standing that currently holds the Learning Competency status.
j. “MOC” means the “Official Microsoft Learning Product” instructor-led courseware known as Microsoft
Official Course that educates IT professionals and developers on Microsoft technologies.
k. “MPN Member” means an active Microsoft Partner Network program member in good standing.
MCT USE ONLY. STUDENT USE PROHIBITED
l. “Personal Device” means one (1) personal computer, device, workstation or other digital electronic device
that you personally own or control that meets or exceeds the hardware level specified for the particular
Microsoft Instructor-Led Courseware.
m. “Private Training Session” means the instructor-led training classes provided by MPN Members for
corporate customers to teach a predefined learning objective using Microsoft Instructor-Led Courseware.
These classes are not advertised or promoted to the general public and class attendance is restricted to
individuals employed by or contracted by the corporate customer.
n. “Trainer” means (i) an academically accredited educator engaged by a Microsoft IT Academy Program
Member to teach an Authorized Training Session, and/or (ii) a MCT.
o. “Trainer Content” means the trainer version of the Microsoft Instructor-Led Courseware and additional
supplemental content designated solely for Trainers’ use to teach a training session using the Microsoft
Instructor-Led Courseware. Trainer Content may include Microsoft PowerPoint presentations, trainer
preparation guide, train the trainer materials, Microsoft One Note packs, classroom setup guide and Pre-
release course feedback form. To clarify, Trainer Content does not include any software, virtual hard
disks or virtual machines.
2. USE RIGHTS. The Licensed Content is licensed not sold. The Licensed Content is licensed on a one copy
per user basis, such that you must acquire a license for each individual that accesses or uses the Licensed
Content.
2.1 Below are five separate sets of use rights. Only one set of rights apply to you.
2.2 Separation of Components. The Licensed Content is licensed as a single unit and you may not
separate their components and install them on different devices.
2.3 Redistribution of Licensed Content. Except as expressly provided in the use rights above, you may
not distribute any Licensed Content or any portion thereof (including any permitted modifications) to any
third parties without the express written permission of Microsoft.
2.4 Third Party Notices. The Licensed Content may include third party code tent that Microsoft, not the
third party, licenses to you under this agreement. Notices, if any, for the third party code ntent are included
for your information only.
2.5 Additional Terms. Some Licensed Content may contain components with additional terms,
conditions, and licenses regarding its use. Any non-conflicting terms in those conditions and licenses also
apply to your use of that respective component and supplements the terms described in this agreement.
a. Pre-Release Licensed Content. This Licensed Content subject matter is on the Pre-release version of
the Microsoft technology. The technology may not work the way a final version of the technology will
and we may change the technology for the final version. We also may not release a final version.
Licensed Content based on the final version of the technology may not contain the same information as
the Licensed Content based on the Pre-release version. Microsoft is under no obligation to provide you
with any further content, including any Licensed Content based on the final version of the technology.
b. Feedback. If you agree to give feedback about the Licensed Content to Microsoft, either directly or
through its third party designee, 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 technology, Microsoft product, or service that includes the feedback.
You will not give feedback that is subject to a license that requires Microsoft to license its technology,
technologies, or products to third parties because we include your feedback in them. These rights
survive this agreement.
c. Pre-release Term. If you are an Microsoft IT Academy Program Member, Microsoft Learning
Competency Member, MPN Member or Trainer, you will cease using all copies of the Licensed Content on
the Pre-release technology upon (i) the date which Microsoft informs you is the end date for using the
Licensed Content on the Pre-release technology, or (ii) sixty (60) days after the commercial release of the
technology that is the subject of the Licensed Content, whichever is earliest (“Pre-release term”).
Upon expiration or termination of the Pre-release term, you will irretrievably delete and destroy all copies
of the Licensed Content in your possession or under your control.
MCT USE ONLY. STUDENT USE PROHIBITED
4. SCOPE OF LICENSE. The Licensed Content is licensed, not sold. This agreement only gives you some
rights to use the Licensed Content. Microsoft reserves all other rights. Unless applicable law gives you more
rights despite this limitation, you may use the Licensed Content only as expressly permitted in this
agreement. In doing so, you must comply with any technical limitations in the Licensed Content that only
allows you to use it in certain ways. Except as expressly permitted in this agreement, you may not:
• access or allow any individual to access the Licensed Content if they have not acquired a valid license
for the Licensed Content,
• alter, remove or obscure any copyright or other protective notices (including watermarks), branding
or identifications contained in the Licensed Content,
• modify or create a derivative work of any Licensed Content,
• publicly display, or make the Licensed Content available for others to access or use,
• copy, print, install, sell, publish, transmit, lend, adapt, reuse, link to or post, make available or
distribute the Licensed Content to any third party,
• work around any technical limitations in the Licensed Content, or
• reverse engineer, decompile, remove or otherwise thwart any protections or disassemble the
Licensed Content except and only to the extent that applicable law expressly permits, despite this
limitation.
5. RESERVATION OF RIGHTS AND OWNERSHIP. Microsoft reserves all rights not expressly granted to
you in this agreement. The Licensed Content is protected by copyright and other intellectual property laws
and treaties. Microsoft or its suppliers own the title, copyright, and other intellectual property rights in the
Licensed Content.
6. EXPORT RESTRICTIONS. The Licensed Content is subject to United States export laws and regulations.
You must comply with all domestic and international export laws and regulations that apply to the Licensed
Content. These laws include restrictions on destinations, end users and end use. For additional information,
see www.microsoft.com/exporting.
7. SUPPORT SERVICES. Because the Licensed Content is “as is”, we may not provide support services for it.
8. TERMINATION. Without prejudice to any other rights, Microsoft may terminate this agreement if you fail
to comply with the terms and conditions of this agreement. Upon termination of this agreement for any
reason, you will immediately stop all use of and delete and destroy all copies of the Licensed Content in
your possession or under your control.
9. LINKS TO THIRD PARTY SITES. You may link to third party sites through the use of the Licensed
Content. The third party sites are not under the control of Microsoft, and Microsoft is not responsible for
the contents of any third party sites, any links contained in third party sites, or any changes or updates to
third party sites. Microsoft is not responsible for webcasting or any other form of transmission received
from any third party sites. Microsoft is providing these links to third party sites to you only as a
convenience, and the inclusion of any link does not imply an endorsement by Microsoft of the third party
site.
10. ENTIRE AGREEMENT. This agreement, and any additional terms for the Trainer Content, updates and
supplements are the entire agreement for the Licensed Content, updates and supplements.
12. LEGAL EFFECT. This agreement describes certain legal rights. You may have other rights under the laws
of your country. You may also have rights with respect to the party from whom you acquired the Licensed
Content. This agreement does not change your rights under the laws of your country if the laws of your
country do not permit it to do so.
13. DISCLAIMER OF WARRANTY. THE LICENSED CONTENT IS LICENSED "AS-IS" AND "AS
AVAILABLE." YOU BEAR THE RISK OF USING IT. MICROSOFT AND ITS RESPECTIVE
AFFILIATES GIVES NO EXPRESS WARRANTIES, GUARANTEES, OR CONDITIONS. YOU MAY
HAVE ADDITIONAL CONSUMER RIGHTS UNDER YOUR LOCAL LAWS WHICH THIS AGREEMENT
CANNOT CHANGE. TO THE EXTENT PERMITTED UNDER YOUR LOCAL LAWS, MICROSOFT AND
ITS RESPECTIVE AFFILIATES EXCLUDES ANY IMPLIED WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
14. LIMITATION ON AND EXCLUSION OF REMEDIES AND DAMAGES. YOU CAN RECOVER FROM
MICROSOFT, ITS RESPECTIVE AFFILIATES AND ITS SUPPLIERS ONLY DIRECT DAMAGES UP
TO US$5.00. YOU CANNOT RECOVER ANY OTHER DAMAGES, INCLUDING CONSEQUENTIAL,
LOST PROFITS, SPECIAL, INDIRECT OR INCIDENTAL DAMAGES.
It also applies even if Microsoft knew or should have known about the possibility of the damages. The
above limitation or exclusion may not apply to you because your country may not allow the exclusion or
limitation of incidental, consequential or other damages.
Please note: As this Licensed Content is distributed in Quebec, Canada, some of the clauses in this
agreement are provided below in French.
Remarque : Ce le contenu sous licence étant distribué au Québec, Canada, certaines des clauses
dans ce contrat sont fournies ci-dessous en français.
EXONÉRATION DE GARANTIE. Le contenu sous licence visé par une licence est offert « tel quel ». Toute
utilisation de ce contenu sous licence est à votre seule risque et péril. Microsoft n’accorde aucune autre garantie
expresse. Vous pouvez bénéficier de droits additionnels en vertu du droit local sur la protection dues
consommateurs, que ce contrat ne peut modifier. La ou elles sont permises par le droit locale, les garanties
implicites de qualité marchande, d’adéquation à un usage particulier et d’absence de contrefaçon sont exclues.
EFFET JURIDIQUE. Le présent contrat décrit certains droits juridiques. Vous pourriez avoir d’autres droits
prévus par les lois de votre pays. Le présent contrat ne modifie pas les droits que vous confèrent les lois de votre
pays si celles-ci ne le permettent pas.
Acknowledgments
Microsoft Learning wants to acknowledge and thank the following for their contribution toward
developing this title. Their effort at various stages in the development has ensured that you have a good
classroom experience.
Contents
Module 1: Overview of the Microsoft Azure Platform
Lesson 1: Azure Services 1-2
Lesson 2: Management Portals 1-5
Course Description
Note: This first release (‘A’) MOC version of course 20532A has been developed on pre-release
software. Microsoft Learning will release a ‘B’ version of this course with enhanced PowerPoint
slides, copy-edited content, and Course Companion content on Microsoft Learning site.
This course is intended for students who have experience building vertically scaled applications. Students
will also have experience with the Microsoft Azure platform and a basic understanding of the services
offered.
This course offers students the opportunity to take an existing ASP.NET MVC application and expand its
functionality as part of moving it to Azure. This course focuses on the considerations necessary when
building a highly available solution in the cloud. This course also prepares the students for the 70-532:
Developing Microsoft Azure Solutions certification exam.
Audience
The candidates targeted by this training have basic experience in implementing and monitoring Microsoft
Azure solutions. Candidates are also proficient with the development tools, techniques and approaches
used to build application solutions.
Student Prerequisites
In addition to their professional experience, students must have experience working with the Azure
platform. They will also have a general understanding of ASP.NET and C# concepts for the lab scenario.
Candidates experience can include:
• Compare services available in the Azure platform
Course Objectives
After completing this course, students will be able to:
Course Outline
The course outline is as follows:
Module 1, "Overview of the Microsoft Azure Platform"
Course Materials
The following materials are included with your kit:
MCT USE ONLY. STUDENT USE PROHIBITED
About This Course xix
• Course Handbook: a succinct classroom learning guide that provides the critical technical
information in a crisp, tightly-focused format, which is essential for an effective in-class learning
experience.
• Lessons: guide you through the learning objectives and provide the key points that are critical to
the success of the in-class learning experience.
• Labs: provide a real-world, hands-on platform for you to apply the knowledge and skills learned
in the module.
• Module Reviews and Takeaways: provide on-the-job reference material to boost knowledge
and skills retention.
• Modules: include companion content, such as questions and answers, detailed demo steps and
additional reading links, for each lesson. Additionally, they include Lab Review questions and
answers and Module Reviews and Takeaways sections, which contain the review questions and
answers, best practices, common issues and troubleshooting tips with answers, and real-world
issues and scenarios with answers.
• Resources: include well-categorized additional resources that give you immediate access to the
most current premium content on TechNet, MSDN®, or Microsoft® Press®.
Note: For this version of the Courseware on Prerelease Software, Companion Content is not
available. However, the Companion Content will be published when the next (B) version of this
course is released, and students who have taken this course will be able to download the
Companion Content at that time from the
http://www.microsoft.com/learning/companionmoc site. Please check with your instructor
when the ‘B’ version of this course is scheduled to release to learn when you can access
Companion Content for this course.
Student Course files: includes the Allfiles.exe, a self-extracting executable file that contains all
required files for the labs and demonstrations.
Note: The Student Allfiles for this version of course is available on
http://www.microsoft.com/learning/companionmoc/ site
• Course evaluation: at the end of the course, you will have the opportunity to complete an online
evaluation to provide feedback on the course, training facility, and instructor.
Course Files
The files associated with the labs in this course are available on
http://www.microsoft.com/learning/companionmoc/ site
Classroom Setup
This course requires a classroom with a minimum of one computer for the instructor and one for each
student. This course requires that the instructor and student computers have internet access. Students will
require Azure accounts to be able to complete the Labs.
Hardware Level 6
• Processor: 64 bit Intel Virtualization Technology (Intel VT) or AMD Virtualization (AMD-V) processor
(2.8 Ghz dual core or better recommended)
• Hard Disk: Dual 120 GB hard disks 7200 RPM SATA or better (striped)
• RAM: 4 GB RAM expandable to 8GB or higher
• DVD/CD: DVD; dual layer recommended.
• Network Adapter
• Sound Card with amplified speakers
• Monitor: Super VGA monitor (17 inch/43 cm)
In addition, the instructor computer must be connected to a projection display device that supports SVGA
1024 x 768 pixels, 16 bit colors.
MCT USE ONLY. STUDENT USE PROHIBITED
1-1
Module 1
Overview of the Microsoft Azure™ Platform
Contents:
Module Overview 1-1
Module Overview
Microsoft Azure provides a collection of services that can be used as building blocks for your cloud
applications. Lesson 1, “Azure Services”, provides a recap of services you may have worked with when
using the Azure platform in the past. Lesson 2, “Management Portals”, describes the two current portals
available for managing Azure subscriptions and services. Lesson 3, “Lab Overview”, provides a
walkthrough of the lab application that you will be working on throughout the course.
Objectives
After completing this module, you will be able to:
Lesson 1
Azure Services
This lesson describes some of the common services and features that are available in Azure and used by
many entry-level Azure developers and IT pros.
Lesson Objectives
After completing this lesson, you will be able to:
o Virtual Machines
o Cloud Services
o Storage
o SQL Databases
o Virtual Networks
Services Overview
Web Sites
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 1-3
Virtual Machines
Cloud Services
Storage
MCT USE ONLY. STUDENT USE PROHIBITED
1-4 Overview of the Microsoft Azure™ Platform
SQL Databases
Virtual Networks
App Services
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 1-5
Lesson 2
Management Portals
As the Azure platform has grown, there have been many iterations of the services available and web
applications used to manage the services.
This lesson will describe the three latest iterations of the Management Portal used for configuring
instances of Azure services. This lesson will also provide a walkthrough of how to switch between the two
Azure Management Portals when you require functionality that is not available in the Preview Portal.
Lesson Objectives
After completing this lesson, you will be able to:
Demonstration Steps
1. Open the Azure Preview Portal (https://portal.azure.com).
2. View the Customization mode for the Startboard.
6. In the Create VM (Ubuntu Server) journey, view the journey part for creating an associated Virtual
Network.
7. Close the Create VM blade to view the warning dialog for losing changes in a journey or part.
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 1-7
Portal URLs
Demonstration Steps
1. Open the Azure Management Portal (https://manage.windowsazure.com).
2. Login using your Microsoft Account credentials associated with your Azure account.
3. Create a Web Site instance using the Quick Create options and these details:
o Url: Pick a unique name for the website
o Web Hosting Plan: Create new hosting plan
5. View the details for the Website created in the previous steps.
Best Practice: Many of the services covered in this module are pre-requisites for the
course. If there are any services mentioned that you have never worked with, please take time to
review these services before completing the subsequent modules. This will ensure that you are
prepared for the later modules in this course.
Review Question(s)
Question: You are building an iOS and Android application. Your application will need a
back-end web service and you have decided to host the service in Azure. What services can
you use to accomplish this task?
MCT USE ONLY. STUDENT USE PROHIBITED
2-1
Module 2
Establishing a Development Environment using Azure™
Virtual Machines
Contents:
Module Overview 2-1
Module Overview
While many of the Azure services use virtualized machines, sometimes your application has a unique
enough need that you would like a Virtual Machine (VM) that is completely unmanaged. As part of its
Infrastructure as a Service (IaaS) offerings, Azure provides networking, backup and virtualization services.
Lesson 1, “Azure Virtual Machines”, introduces the Virtual Machines service and described the options for
creating a virtual machine. Lesson 2, “Azure Virtual Machine Workloads”, details the types of workloads
that can be deployed to a Virtual Machine. Lesson 3, “Migrating Azure Virtual Machine Instances”,
discusses the options for migrating VMs to and from Azure.
Objectives
After completing this module, you will be able to:
• Describe the Virtual Machines service in Azure.
Lesson 1
Constructing Azure Virtual Machines
Virtual Machines in Azure provides quick compute that can be scaled out and completely customized.
With a large collection of templates provided in the Management Portal, it is very easy to get started with
a popular server OS.
This lesson will describe the Virtual Machine service in Azure and detail some of its unique features.
Lesson Objectives
After completing this lesson, you will be able to:
• Describe the Azure Virtual Machines service.
Capturing a VM Image
VM Depot
Lesson 2
Azure Virtual Machine Workloads
Your existing application workloads can be deployed to Azure Virtual Machines whether they run on
Windows or Linux.
This lesson will describe some of the considerations for deploying application workloads to Virtual
Machines in Azure.
Lesson Objectives
After completing this lesson, you will be able to describe the considerations when deploying Windows or
Linux workloads to Azure.
Windows Workloads
Linux Workloads
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 2-5
Lesson 3
Migrating Azure Virtual Machine Instances
Azure provides infrastructure options that makes it easy to either extend your existing data center or
create a new environment in the cloud. With Networking, Backup, Recovery and Virtual Machines; Azure
has the services necessary to deploy your existing complex production applications.
This lesson describes the various methods of migrating your Virtual Machines to Azure.
Lesson Objectives
After completing this lesson, you will be able to:
• Migrate VMs to Azure.
Objectives
After you complete this lab, you will be able to:
1. Verify that you received credentials to log into the Azure portal from you training provider, these
credentials and the Azure account will be used throughout the labs of this course.
o Name: Net20532A
Results: After completing this exercise, you will have a new Virtual Network in Azure.
o Password: TestPa$$w0rd
o Pricing Tier: A3 Standard
o Size (GB): 6
o Storage Account: stor20532[Your Name Here]
Results: After completing this exercise, you will have a new Virtual Machine stored in a new Storage
account.
o Drive Letter: F
4. Download the 20532A AllFiles compressed folder from the Companion MOC website
(http://www.microsoft.com/learning/companionmoc).
5. Extract the AllFiles content to the F: drive
6. Extract target: Allfiles (F):\
o Url: http://go.microsoft.com/fwlink/?LinkID=510170
2. Install the Visual Studio 2013 Ultimate Trial.
3. Reconnect to the Virtual Machine.
4. Launch Visual Studio 2013 Ultimate for the first time.
5. Close Visual Studio 2013 Ultimate.
o Url: http://go.microsoft.com/fwlink/?LinkID=510171
2. In Web Platform Installer, install the Windows Azure SDK for .NET (VS 2013) – 2.4 package.
Results: After completing this exercise, your development Virtual Machine will have Visual Studio and the
Azure SDK installed.
1. Use the System Preperation Tool with the Azure Virtual Machine
Task 1: Use the System Preperation Tool with the Azure Virtual Machine
1. Open a Command Prompt window as an administrator.
o Generalize: Yes
o Shutdown Options: Shutdown
Note: You will be disconnected from the Virtual Machine once SysPrep is completed. The VM
will shutdown and this will close your RDP connection.
3. Capture an image from your running Virtual Machine using the following options:
o Image Name: vm20532Template
Results: After completing this exercise, you will have a custom image in Azure that can be used to create
new Virtual Machines.
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 2-11
Module 3
Managing Infrastructure in Azure™
Contents:
Module Overview 3-1
Module Overview
Creating Virtual Machines is simply the beginning of the options and functionality you will use with
Azure’s infrastructure services. For developer operations (DevOps) tasks, you will need to be able to
deploy VMs, manage configurations and networks along with customizing both your infrastructure
compute instances and their network connectivity to meet your outbound connection requirements.
Lesson 1, “Azure Virtual Networks”, reviews the VNET offering available in Azure. Lesson 2, “Highly
Available Azure Virtual Machines”, reviews the options and features that must be considered when
designing your Virtual Machine instances for high availability scenarios. Lesson 3, “Virtual Machine
Configuration Management”, showcases common methods of reliably managing and duplicating
configuration for VMs. Lesson 4, “Customizing Azure Virtual Machine Networking”, reviews the options
for managing inbound/outbound connection rules for your VM.
Objectives
After completing this module, you will be able to:
• Describe options for allowing anonymous and private access to a VM and its port
• Customize the networking rules for a VM
MCT USE ONLY. STUDENT USE PROHIBITED
3-2 Managing Infrastructure in Azure™
Lesson 1
Azure Virtual Networks
Virtual Networks in Azure provides a method of logically grouping related service instances such as Cloud
Services and Virtual Machines. These services can then communicate privately without the need to create
an anonymous, publically accessible endpoint.
Lesson Objectives
After completing this lesson, you will be able to:
Lesson 2
Highly Available Azure Virtual Machines
Horizontal or vertical scaling can be used with Virtual Machines and load balancing for a High Availability
scenario. Availability Sets also affect the availability of your VMs during faults or upgrades.
This lesson will describe the considerations for designing your Virtual Machine collections for high
availability scenarios.
Lesson Objectives
After completing this lesson, you will be able to:
Availability Sets
MCT USE ONLY. STUDENT USE PROHIBITED
3-4 Managing Infrastructure in Azure™
Lesson 3
Virtual Machine Configuration Management
Although each Virtual Machine can be configured manually, automating the configuration of a VM can
lead to repeatable, efficient, and testable deployment scenarios. Automating configuration can also
ensure that newly scaled instances of a VM match the other instances.
This lesson will discuss some of the most common methods of configuration management.
Lesson Objectives
After completing this lesson, you will be able to:
• Explain how PowerShell Desired State Configuration can be used for Virtual Machine configuration
management.
• Describe the VM Agent service in Azure Virtual Machines.
VM Agent
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 3-5
Lesson 4
Customizing Azure Virtual Machine Networking
While Azure Virtual Machines can be useful right away after their creation, additional configuration may
need to be performed before interfacing these instances with external resources or other VMs.
This lesson will describe the methods used for customizing the network connectivity of an Azure Virtual
Machine.
Lesson Objectives
After completing this lesson, you will be able to:
Custom Endpoints
Firewall Rules
Public VIP
MCT USE ONLY. STUDENT USE PROHIBITED
3-8 Managing Infrastructure in Azure™
Objectives
After you complete this lab, you will be able to:
2. Verify that you received credentials to log into the Azure portal from you training provider, these
credentials and the Azure account will be used throughout the labs of this course.
o Password: TestPa$$w0rd
3. Enable SQL Server and Windows Authentication Mode in the SQL Server Settings menu.
Results: After completing this exercise, your will have a new Virtual Machine with SQL installed that can
use Mixed Mode authentication when accessed by an external Virtual Machine.
o Image: vm20532Template
o Host Name: vm20532a[Your Name Here]
o Password: TestPa$$w0rd
o Pricing Tier: A2 Standard
Results: After completing this exercise, you will have a new Virtual Machine created from your
development image.
Exercise 3: Connect the Test Application to the SQL Server Virtual Machine
Scenario
You have a test ASP.NET application that can verify whether or not you can access a SQL Server instance.
You will debug this application in your development Virtual Machine to verify that you can access your
SQL Server instance on the private network.
2. View the blade for your db20532a[Your Name Here] Virtual Machine.
Task 4: Repair the Azure SDK for .NET Storage Emulator Installation
Note: When using SysPrep with your original application VM, the user that installed the
Storage Emulator is removed. When you create a new VM from the template, you create a new
user and this user does not have access to some of the files and applications that the old user
could access. Because of this, you must repair the Storage Emulator Installation.
o Url: http://go.microsoft.com/fwlink/?LinkID=510171
Note: Since this is your first time starting Visual Studio with this sysprep image, you will
have to walk through the setup steps for Visual Studio again. Visual Studio detects that you are a
“new user” using the product for the first time.
2. Debug the web application and provide the SQL Server VM’s Internal IP Address to the IP Address
dialog on the home page to test that you can connect to the VM successfully in your Virtual Network.
Note: Even though you can successfully connect to your VM in the VNET, this does not necessarily
mean that the VM is accessible through the same ports to the outside world.
Results: After completing this exercise, you will have used the Internal IP address of the Database Virtual
Machine in your Virtual Network to connect to SQL Server 2014.
Task 1: Install the Web Server Role and ASP.NET Hosting Functionality
1. Open the Server Manager application.
o Roles
• ASP.NET 4.5
o Server: localhost
3. Verify that the http://localhost/ web application works the same as it did in the previous exercise by
using the Internal IP Address for the SQL Server VM.
2. View the blade for your vm20532a[Your Name Here] Virtual Machine.
3. Add a new Endpoint to the VM with the following details:
o Endpoint: HTTP
o Protocol: TCP
o Public Port: 80
o Private Port: 80
o Floating IP: Disabled
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 3-13
Note: You can observe the Endpoints blade or the Notifications blade to determine when
your Endpoint creation task is complete.
2. In Internet Explorer navigate to the Domain Name of your Virtual Machine instance.
3. Verify that the http://vm20532a[Your Name Here].cloudapp.net/ web application works the same
as it did in the previous exercise by using the Internal IP Address for the SQL Server VM.
Results: After completing this exercise, you will have enabled IIS and the ASP.NET features on your
Windows Server 2012 R2 Virtual Machine and created a custom HTTP Endpoint for port 80 to view your
web server from any public browser.
Verify the correctness of the statement by placing a mark in the column to the right.
Statement Answer
You can use SQL Server Management Studio to connect to your SQL Server
VM with its current configuration from any machine?
MCT USE ONLY. STUDENT USE PROHIBITED
3-14 Managing Infrastructure in Azure™
Lesson 5
Using Remote Desktop Protocol (RDP) to Connect to a
Virtual Machine
In future labs, you will need to use Remote Desktop Protocol (RDP) to connect to your Development
Environment.
This lesson demonstrates how to use the RDP protocol to remotely connect to your Azure Virtual Machine
so that you can complete future labs in this course.
Lesson Objectives
After completing this lesson, you will be able to:
• Verify that you received credentials to log into the Azure portal from you training provider, these
credentials and the Azure account will be used throughout the labs of this course.
Demonstration Steps
1. Log into the Azure Preview Portal (https://portal.azure.com).
2. View the blade for your Virtual Machine created in the previous lab.
4. Record the Public Port value of the Remote Desktop standalone endpoint for your Virtual Machine.
5. Use the Remote Desktop Connection application to connect to your VM by manually entering the
address in this format:
o [Domain Name]:[Public Port]
8. Download the RDP file for your Virtual Machine and save the file in any directory.
9. Use File Explorer to Double-click the RDP file you have just downloaded.
11. Return to the Microsoft Azure tab in your Internet Explorer window.
12. Connect to your VM by using the Connect button in the Virtual Machine’s blade.
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 3-15
Review Question(s)
Question: You are working with a small organization that does not have any on-site
hardware. However, they would like their software developers to be able to VPN to their
Azure Virtual Network when testing software features. Should you establish a point-to-site
or site-to-site network connection?
MCT USE ONLY. STUDENT USE PROHIBITED
3-16 Managing Infrastructure in Azure™
MCT USE ONLY. STUDENT USE PROHIBITED
4-1
Module 4
Web Infrastructure in the Azure™ Platform
Contents:
Module Overview 4-1
Lab: Creating an ASP.NET Web Site Using Azure Web Sites 4-13
Module Overview
This module provides an overview of the Azure Web Sites service offering. Lesson 1, “Azure Web Sites”,
describes the Web Sites service in Azure. Lesson 2, “Hosting Web Applications in Azure“, describes the
behavior and lifecycle of an Azure Web Site. Lesson 3, “Configuring an Azure Web Site”, discusses the
various configuration options available. Lesson 4, “Publishing an Azure Web Site”, goes into the publish
process. Lesson 5, “Monitoring an Azure Web Site”, lists the available options for metrics, monitoring and
diagnostics.
Objectives
After completing this module, you will be able to:
Lesson 1
Azure Web Sites
In many scenarios, a quick and easy way to deploy web applications to the Cloud is preferred over
reengineering web applications as cloud projects. Azure Web Sites provides an offering that allows for
rapid iteration and creation of a web application.
Lesson Objectives
After completing this lesson, you will be able to:
2. Create a new Website + SQL instance (resource group) using a unique name and these details:
o Password: TestPa$$w0rd
Lesson 2
Hosting Web Applications in Azure
One of the advantages of deploying a web application in Azure Web Sites is the familiar hosting model.
Azure Web Sites make use of IIS and WebDeploy packages to host applications the same way as they are
hosted on premise.
This lesson will describe the lifecycle of Azure Web Sites instances and how they are hosted.
Lesson Objectives
After completing this lesson, you will be able to:
• Describe the differences between Standard tier Web Site instances and other tiers.
Lesson 3
Configuring an Azure Web Site
Azure Web Sites provide a lot of extra features that can be leveraged to expand your web application’s
capabilities. By using the management portal, different Web Site features can be enabled and custom
settings for the website can be modified without redeploying the web application.
This lesson lists the different configuration options available for an Azure Web Site.
Lesson Objectives
After completing this lesson, you will be able to:
Always On
Linked Resources
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 4-7
Domain Names
Lesson 4
Publishing an Azure Web Site
After developing a web application, WebDeploy can be leveraged to publish that web application to
Azure. The Visual Studio publish wizard also allows for customization to be performed on the
configuration settings and connection strings immediately prior to the actual publish action.
This lesson describes the publish process available through the Visual Studio 2013 publish wizard.
Lesson Objectives
After completing this lesson, you will be able to:
• Describe how to publish using the Publish Wizard in Visual Studio 2013.
• Describe the difference between the standard Release and Debug builds.
Web.config Transformations
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 4-9
Lesson 5
Monitoring an Azure Web Site
After deploying a web application to a cloud platform, tracing and metrics become more critical than
ever. Without the ability to remotely connect to a hosting virtual machine, logs become an important
part of the forensic analysis process when there are issues with a web application.
This lesson describes the different options available for monitoring an Azure Web Site.
Lesson Objectives
After completing this lesson, you will be able to:
Remote Debugging
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 4-11
Diagnostics
MCT USE ONLY. STUDENT USE PROHIBITED
4-12 Web Infrastructure in the Azure™ Platform
Lesson 6
Lab Overview
Before working with the Contoso Events web applications, this lesson will introduce the application from a
high-level. You will see the Administration web application and the Public-facing Web front-end for the
Contoso Events web application.
Lesson Objectives
After completing this lesson, you will have an understanding of how the Contoso.Events web solution
works.
3. Debug the Contoso.Events.Data.Generation project to generate the SQL and Azure Storage Tables
data.
4. Close Microsoft Visual Studio 2013.
9. After the Contoso Events (Contoso.Events.Cloud) website is open, use IIS Express to open the
Contoso.Events.Administration website.
10. Select any Sales Conference event on the Contoso Events web site and register for that event using
the following details:
o Region: Western
o AnnualSales: 45000
o FirstName: Corrine
o LastName: Horn
11. Locate the same event in the Events List on the Contoso Events Administration web site.
In this lab, you will create an Azure Web Site, deploy your existing application and then configure the web
site after deployment.
Objectives
After you complete this lab, you will be able to:
For this lab, you will use the available host machine. Before you begin this lab, you must complete the
following steps:
1. Prior to starting this lab, you must have completed the labs in Modules 2 and 3.
2. On the host computer, click Start, type Remote, and then click Remote Desktop Connection.
3. In Remote Desktop Connection, provide the name of your virtual machine in the Computer dialog
box using this format: vm20532a[Your Name Here].cloudapp.net:[Your VM RDP Port]
Note: The name and port for your VM may already be saved in the drop-down list when
selecting a Computer. If this is the case, use this value instead of typing it in manually. If you are
unsure about your VM’s RDP port, use either of the Azure portal to look up your VM’s endpoints.
The endpoint with the name Remote Desktop is the correct port for RDP. This port is
randomized to protect your VM from unauthorized access.
4. In Remote Desktop Connection, click Connect. Wait until the RDP client accesses the virtual machine.
5. If necessary, sign in using the following credentials:
6. Verify that you received credentials to log into the Azure portal from you training provider, these
credentials and the Azure account will be used throughout the labs of this course.
2. Create a new Custom Web Site instance using a unique name and these details:
Note: Be sure to record your SQL admin username and password. It will be very difficult
and time consuming to recover this information if lost.
Results: After completing this exercise, you will be able to use the Management Portal to create Azure
Web Site instances and browse to the instance.
• Publish a web application using the Visual Studio 2013 Publish Wizard.
The main tasks for this exercise are as follows:
1. Open an Existing ASP.NET Web Application Project with Visual Studio 2013
Task 1: Open an Existing ASP.NET Web Application Project with Visual Studio 2013
1. Open the Contoso.Events solution from the following location:
Task 2: Download the Publish Profile for the Azure Web Site
1. Log into the Azure Management Portal (https://manage.windowsazure.com).
2. Browse to your previously created Web Site’s dashboard.
Task 3: Publish the ASP.NET Web Application to the Azure Web Site
1. Publish the ASP.NET web application using the publish profile.
Results: After completing this exercise, you will be able to use a publish profile to publish web
applications directly an Azure Web Site.
2. Update the EventsListViewModel class to use an AppSetting to set the EventCount property in its
constructor:
4. Verify that the local web application is now using the AppSetting.
3. Add an App Settings entry to the Web Site configuration to override the web.config AppSetting
o App Setting Key: EventsListViewModel.EventCount
Results: After completing this exercise, you will be able to leverage custom appSettings using a
web.config or the Azure Management Portal.
Lab Review
Verify the correctness of the statement by placing a mark in the column to the right.
Statement Answer
Best Practice: Even though we discussed WebDeploy publishing in Azure, the same
process can be followed for deploying applications on premise. WebDeploy can be used to
decouple developers from the release process and provide a single package that can be used by
an administrator to deploy the application in production.
Review Question(s)
Question: What are some of the business scenarios where it makes sense to Scale your
website on a schedule?
Question: Why would you want to store logs in a central location for multiple Web Site
instances?
Question: Why would you consider leaving log files on the file system for a Web Site
instance?
MCT USE ONLY. STUDENT USE PROHIBITED
4-18 Web Infrastructure in the Azure™ Platform
MCT USE ONLY. STUDENT USE PROHIBITED
5-1
Module 5
Designing Cloud Applications for Resiliency
Contents:
Module Overview 5-1
Module Overview
As a developer, some considerations must be taken when designing applications for the cloud. While
there are many platform improvements available in the ASP.NET ecosystem, scalability and reliability
metrics for cloud applications dictate that you rethink how you design your applications and the patterns
used. Lesson 1, “Application Design Practices for Highly Available Applications”, discusses some of the
considerations that need to be taken when designing applications that are hosted in the cloud so that
they have minimal downtime. Lesson 2, “Building High Performance Applications using ASP.NET”,
describes the changes to the ASP.NET stack in .NET 4.5 that improve the frameworks performance in web
applications. Lesson 3, “Common Cloud Application Patterns”, introduces a small set of example patterns
from the MSDN cloud patterns reference. Lesson 4, “Application Analytics”, demonstrates the Application
Insights service. Lesson 5, “Caching Application Data”, compares and contrasts the Azure and Redis Cache
services.
MCT USE ONLY. STUDENT USE PROHIBITED
5-2 Designing Cloud Applications for Resiliency
Lesson 1
Application Design Practices for Highly Available
Applications
This lesson describes some of the common considerations for designing highly available applications.
Lesson Objectives
After completing this lesson, you will be able to:
• Describe how you can split your application into units of work.
• Describe queue and load balancing strategies for applications.
Load Balancing
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 5-3
Queues
MCT USE ONLY. STUDENT USE PROHIBITED
5-4 Designing Cloud Applications for Resiliency
Lesson 2
Building High Performance Applications using ASP.NET
The ASP.NET 4.5 release contained many improvements to the platform that help when building high
performance applications both on-premise and in the cloud.
This lesson describes the improvements to ASP.NET for high performance web applications.
Lesson Objectives
After completing this lesson, you will be able to:
Async Keyword
State Management
MCT USE ONLY. STUDENT USE PROHIBITED
5-6 Designing Cloud Applications for Resiliency
Lesson 3
Common Cloud Application Patterns
While there are many application patterns, some application patterns have emerged with a new
generation of cloud-native web applications. MSDN includes a curated list of some of the most common
cloud application patterns.
This lesson will describe in detail three examples of the curated cloud application patterns.
Lesson Objectives
After completing this lesson, you will be able to:
Retry Pattern
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 5-7
Valet-Key Pattern
Sharding Pattern
MCT USE ONLY. STUDENT USE PROHIBITED
5-8 Designing Cloud Applications for Resiliency
Lesson 4
Application Analytics
Analytic software allows developers and operations the ability to explore both the usage and behavior of
their web application. With cloud application, using analytics becomes more important since you have to
make scaling and design decisions per iteration.
Lesson Objectives
After completing this lesson, you will be able to:
• Integrate the Application Analytics scripts and assemblies with an ASP.NET project
Application Insights
2. Create a new ASP.NET Web Application project with the following details:
o Name: Contoso.Help
o Template: MVC
o Authentication: No Authentication
o (Azure) Host in the cloud: Website
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 5-9
10. Create a web test verifying that the home page is available in another country.
MCT USE ONLY. STUDENT USE PROHIBITED
5-10 Designing Cloud Applications for Resiliency
Lesson 5
Caching Application Data
Azure provides two primary Cache mechanisms that can be used to store consistent data that can be
shared by your application’s services. Although Redis Cache is now the preferred cache mechanism, it is
important to understand Azure Cache as it pertains to existing cloud applications.
This lesson will describe the two cache offerings in Azure, Azure Cache and Redis Cache.
Lesson Objectives
After completing this lesson, you will be able to:
Azure Cache
Redis Cache
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 5-11
Review Question(s)
Question: Why would you want a periodic check (heartbeat) of your Azure Web Site’s
availability across geographic regions?
Question: How could you implement the Valet-Key Pattern using Azure Storage services?
MCT USE ONLY. STUDENT USE PROHIBITED
5-12 Designing Cloud Applications for Resiliency
MCT USE ONLY. STUDENT USE PROHIBITED
6-1
Module 6
Processing Background Logic using Azure
Contents:
Module Overview 6-1
Module Overview
As your application scales out, you will find that some of your business logic will become a bottleneck. IO
intensive operations may start using a third-party service which can take a variable amount of time.
Third-party APIs can have long running logic. In order to facilitate this Cloud Services can container
Worker roles who can execute long-running background logic asynchronously from your web front-end
roles. Lesson 1, “Cloud Service Worker Roles”, introduces Worker Roles and describes the small
differences between them and Web Roles. Lesson 2, “Creating a Worker Role”, shows how you can create
a Worker Role from a C# Library project. Lesson 3, “Configuring a Worker Role”, describes the small
differences when configuring a Worker Role. Lesson 4, “Caching Data using Roles”, details the cache
capability available for roles in a Cloud Service.
Objectives
After completing this module, you will be able to:
• Describe the Azure Cloud Service offering.
• Explain the complexity of Cloud Service deployments as compared to Virtual Machines and Web Sites.
Lesson 1
Overview of Cloud Services
When developing web applications and coming up with a production environment, sometimes our
worries go well beyond the actual logic of the application.
With hardware failures, updates, patches, networking and backup concerns, developing a web application
becomes an exercise in Infrastructure management.
This lesson describes the Cloud Services available in Azure and how they can be used for your applications
without you having to worry about infrastructure.
Lesson Objectives
After completing this lesson, you will be able to:
Lesson 2
Cloud Service Web Roles
Web Roles provide a pre-built web server that can be used to host front-end web applications.
This lesson introduces Web Roles and their relationship with Cloud Services.
Lesson Objectives
After completing this lesson, you will be able to:
Web Endpoints
MCT USE ONLY. STUDENT USE PROHIBITED
6-6 Processing Background Logic using Azure
Role Recycling
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 6-7
Lesson 3
Customizing Cloud Service Configurations
Cloud Service Roles provide a much deeper level of customization than Web Sites. Roles can co-locate
cache, have custom endpoints or even cloud-managed settings.
This lesson describes the customization options available for Web and Worker Roles.
Lesson Objectives
After completing this lesson, you will be able to:
Local Storage
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 6-9
Lesson 4
Updating and Managing Cloud Service Deployments
Cloud Services have a unique deployment process. Understanding the relationship between a Cloud
Service package and its configuration files, you can customize what you want to deploy and the affect it
has on a running Cloud Service (i.e. in-place update).
This lesson reviews the considerations and processes for deploying a Cloud Service package or
configuration changes to either a new service instance or a running instance.
Lesson Objectives
After completing this lesson, you will be able to:
In-Place Updating
MCT USE ONLY. STUDENT USE PROHIBITED
6-10 Processing Background Logic using Azure
Runtime Configuration
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 6-11
Lesson 5
Cloud Service Worker Roles
Worker Roles provide a scalable set of worker processes that can consume messages from a storage mechanism
and process them separately from your client and web front-end projects. This provides you with the flexibility to
scale either your background workers or your front-end projects based on your actual usage.
This lesson introduces Worker Roles and the unique capabilities they provide.
Lesson Objectives
After completing this lesson, you will be able to:
Lesson 6
Cloud Service Worker Role Processing
The Microsoft.WindowsAzure.ServiceRuntime namespace contains a RoleEntryPoint class that is used
as the base class for both Web and Worker Roles. By overriding the OnStart and Run methods, you can
provide a loop for the background worker to execute.
This lesson describes the RoleEntryPoint base class and the methods that need to be overridden to
implement a Worker Role.
Lesson Objectives
After completing this lesson, you will be able to:
• Create an infinite loop for your worker role to use when checking for new messages.
Handling Messages
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 6-15
Lesson 7
Caching Data using Roles
When scaling a cloud application out to many instances, it becomes very important to move any stateful
resources (SessionState, Cache, etc.) to a shared resource. Azure provides a cache service that can be used
in conjunction with Cloud Service roles.
This lesson will introduce the Azure Cache service and describe how you can use it with Cloud Service
roles.
Lesson Objectives
After completing this lesson, you will be able to:
Azure Cache
Named Caches
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 6-17
Lesson 8
Analyzing Applications in Cloud Service Role Instances
The Azure Compute Emulator provides an environment where you can test both your web front-end
application and its diagnostic processes. The emulator allows you to see how a very close approximation
of your application will behave after the Cloud Service is deployed.
This lesson will describe the monitoring options available for Cloud Services and will introduce the Azure
Compute Emulator.
Lesson Objectives
After completing this lesson, you will be able to:
Diagnostics
In this lab, you will create a C# Class Library project, add the appropriate references and add the project
as a Worker Role to your Cloud Service. Then you will use the Azure Compute Emulator to test the Web
and Worker Roles.
Objectives
After you complete this lab, you will be able to:
1. Prior to starting this lab, you must have completed the labs in Modules 2 and 3.
2. On the host computer, click Start, type Remote, and then click Remote Desktop Connection.
3. In Remote Desktop Connection, provide the name of your virtual machine in the Computer dialog
box using this format:
Note: The name and port for your VM may already be saved in the drop-down list when
selecting a Computer. If this is the case, use this value instead of typing it in manually. If you are
unsure about your VM’s RDP port, use either of the Azure portal to look up your VM’s endpoints.
The endpoint with the name Remote Desktop is the correct port for RDP. This port is
randomized to protect your VM from unauthorized access.
4. In Remote Desktop Connection, click Connect. Wait until the RDP client accesses the virtual machine.
o Password: TestPa$$w0rd
6. Verify that you received credentials to log into the Azure portal from you training provider, these
credentials and the Azure account will be used throughout the labs of this course.
4. Implement the Run Logic to Get Requests from the SQL Database
3. Create a new Visual C# Class Library project in the Contoso.Events solution with the following
name:
o Contoso.Events.Worker
Task 2: Add a Reference to the Azure SDK Libraries and Solution Projects
1. Add a reference to the Microsoft.WindowsAzure.ServiceRuntime library in the
Contoso.Events.Worker project.
o Contoso.Events.Models
o Contoso.Events.Data
o Contoso.Events.Documents
3. Using the Package Manager Console, execute the following command targeting the
Contoso.Events.Worker project:
5. Implement the OnStart method with a call to the RoleEntryPoint base OnStart() method. The
OnStart method should also set the ServicePointManager.DefaultConnectionLimit value to 12
before calling the base OnStart() method.
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 6-21
6. Implement the Run method with a simple infinite while loop. The method should write to Trace
using the Trace.WriteLine method when first ran. Within the method’s while loop, a call to
Thread.Sleep should be made for a duration of 10,000 milliseconds and then a call to
Trace.WriteLine should be made to indicate an iteration of the queue.
Task 4: Implement the Run Logic to Get Requests from the SQL Database
1. Add the WorkerRole.cs file to the Contoso.Events.Worker project:
o File location: Allfiles (E):\Mod06\Labfiles\Starter\WorkerRole.cs
3. Replace the entire contents of the App.config configuration file with the below xml:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<connectionStrings>
<add name="EventsContextConnectionString" connectionString="Data
Source=(localdb)\v11.0;Initial Catalog=EventsContextDB;Integrated Security=True
providerName="System.Data.SqlClient" />
</connectionStrings>
</configuration>
Results: After completing this exercise, you will be able to create a Worker Role class library and
implement the appropriate pattern for a background worker.
Task 1: Add Class Library as a Worker Role to the Cloud Service project
1. Unload the Contoso.Events.Worker project from the Contoso.Events solution.
2. Edit the Contoso.Events.Worker.csproj file to have the following element as a child of the
PropertyGroup XML element:
o <RoleType>Worker</RoleType>
3. Reload the Contoso.Events.Worker project.
MCT USE ONLY. STUDENT USE PROHIBITED
6-22 Processing Background Logic using Azure
4. Associate the Contoso.Events.Worker Class Library project with the Contoso.Events.Cloud Cloud
Service project as a Worker Role.
Results: After completing this exercise, you will be able to take an existing Class Library project and turn it
into a Worker Role in an existing Cloud Service project.
3. Wait for the sign-in sheet to be generated then download the sign-in sheet.
4. View the sign-in sheet (.docx file) in WordPad.
Results: After completing this exercise, you will be able to debug a Worker Role.
Lab Review
Instance count when debugging Web Roles
When debugging a Cloud Service, make sure to minimize the amount of instances for your Web and
Worker Roles. The instance count can always be increased prior to publishing the Cloud Service. You can
of course test scalability by slowly increasing instance count but remember that the Azure Compute
Emulator has a maximum role instance count of 50.
Question: What types of C# Class Library projects would be easiest to migrate into Worker
Roles?
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 6-23
Worker Roles afford you another level of flexibility when designing and building your cloud applications.
By migrating long-running or IO bound logic to Worker Roles, you can scale the Web front-end of your
application and background workers in isolation and to more closely meet the real usage needs of your
application.
Review Question(s)
Question: What are some examples of data that needs to be cached but could logically be
stored in different named caches?
Question: What are some reasons that you may have the RoleEntryPoint.Run method’s
implementation end the current “infinite” loop and recycle the role?
Question: What are some of the things that you may have to consider changing about your
existing web applications before migrating them to a Web Role?
Verify the correctness of the statement by placing a mark in the column to the right.
Statement Answer
Web.config settings for Web Roles cannot be changed once you publish the
Cloud Service to Azure.
Module 7
Storing Tabular Data in Azure
Contents:
Module Overview 7-1
Module Overview
Dynamic web applications have always had a need to store the data that is being managed and
manipulated by end users. For as long as ASP.NET has been around, technologies like ADO.NET and
Entity Framework have provided a way for accessing data in SQL Server. In the cloud, the Azure platform
provides a SQL as a Service offering that allows developers to use SQL in much the same manner as they
would on premise. Lesson 1, “What is Azure SQL Databases”, defines the Azure SQL Databases service and
reasons you would consider using it. Lesson 2, “Managing SQL Databases in Azure”, describes the familiar
and new management tools available for use with a SQL database hosted in Azure. Lesson 3, “Using
Azure SQL Databases with SQL Server Data Tools”, deeply describes the SSDT templates, panes and
projects available in Visual Studio 2013. Lesson 4, “Migrating Data to Azure SQL Databases”, describes a
couple of simple methods for migrating an existing schema and data from on premise to the cloud.
Lesson 5, “Using Azure SQL Databases with Entity Framework”, details some of the ways you can leverage
Entity Framework Code First to your advantage when working with a database hosted in the cloud.
Objectives
After completing this module, you will be able to:
• Explain some of the advantages and disadvantages of hosting databases in Azure SQL Databases.
• Explain some of the advantages and disadvantages of hosting databases in a SQL Server installation
on an Azure Virtual Machine.
MCT USE ONLY. STUDENT USE PROHIBITED
7-2 Storing Tabular Data in Azure
• Describe the tools that can be used to manage Azure SQL Databases.
• Describe the Visual Studio 2013 features that can be used to manage Azure SQL Databases.
• Describe the options for migrating data from on premise to the cloud.
• Describe strategies for using Entity Framework with Azure SQL Databases.
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 7-3
Lesson 1
Azure SQL Databases Overview
Azure SQL Databases provides a database-as-a-service offering that allows you to take advantage of
many of the constructs that are already familiar to developers and administrators who have worked with
SQL Server in the past.
This lesson will describe the Azure SQL Databases service, some of the advantages of using this service
and some of the considerations for selecting between the Azure SQL Database service and SQL Server on
an Azure VM.
Lesson Objectives
After completing this lesson, you will be able to:
Sharding
Lesson 2
Managing SQL Databases in Azure
The Azure Management Portal provides convenient ways to create and manage databases. There is also a
unique portal that allows you to manage the various tables, views and other objects for your SQL
database.
This lesson lists the various online management tools available for interacting with Azure SQL Databases.
Lesson Objectives
After completing this lesson, you will be able to:
• Use the Azure SQL Databases Management Portal to manage the tables and views.
Lesson 3
Using Azure SQL Databases with SQL Server Data Tools
One of the advantages of Azure SQL Databases is the ability to use many of the same monitoring tools
that you use for on premise databases.
This lesson describes the existing management tools and how they can be used to manage Azure SQL
Databases.
Lesson Objectives
After completing this lesson, you will be able to:
• Use SQL Server Management Studio to manage your Azure SQL Databases instances.
• Use Visual Studio’s tools to manage your Azure SQL Databases instances.
Lesson 4
Migrating Data to Azure SQL Databases
You may choose to migrate your existing database objects from an on premise database to Azure SQL
Databases. There are many options available for migrating data that align directly with the options
considered for migrating data on premise.
This lesson will describe the various options for migrating data from on premise to the cloud.
Lesson Objectives
After completing this lesson, you will be able to:
Lesson 5
Replication and Recovery of Azure SQL Database Instances
Both SQL Server standalone and Azure SQL Databases offers a comprehensive set of replication and
disaster recovery (DR) options.
This lesson will describe the High Availability related features for both SQL standalone and SQL as a
Service in Azure.
Lesson Objectives
After completing this lesson, you will be able to:
Objectives
After you complete this lab, you will be able to:
• Create an Azure SQL Databases server and database instance using the Management Portal.
• Use Entity Framework Code First to initialize and seed a database in the cloud.
• Use the SQL Azure Databases Management Portal to view live data in the cloud.
• Prior to starting this lab, you must have completed the labs in Modules 2 and 3.
1. On the host computer, click Start, type Remote, and then click Remote Desktop Connection.
2. In Remote Desktop Connection, provide the name of your virtual machine in the Computer dialog
box using this format:
vm20532a[Your Name Here].cloudapp.net:[Your VM RDP Port]
Note: The name and port for your VM may already be saved in the drop-down list when
selecting a Computer. If this is the case, use this value instead of typing it in manually. If you are
unsure about your VM’s RDP port, use either of the Azure portal to look up your VM’s endpoints.
The endpoint with the name Remote Desktop is the correct port for RDP. This port is
randomized to protect your VM from unauthorized access.
3. In Remote Desktop Connection, click Connect. Wait until the RDP client accesses the virtual machine.
o Password: TestPa$$w0rd
5. Verify that you received credentials to log into the Azure portal from you training provider, these
credentials and the Azure account will be used throughout the labs of this course.
o Edition: Web
Results: After completing this exercise, you will be able to create both servers and databases in the Azure
SQL Databases service.
• View tables and data using the Azure SQL Databases Management Portal.
The main tasks for this exercise are as follows:
5. Verify that the Azure Cloud Service Website is using the New Data
6. Login to the Azure Management Portal
Task 1: Run the ASP.NET Web Application to View Events from LocalDb
1. Open the Contoso.Events solution from the following location:
Note: This Data Generation console application simply creates some sample data in your
local SQL database (LocalDb) so that you can test the site.
Database.SetInitializer<EventsContext>(
new EventsContextInitializer()
);
3. At the end of the Seed method, create an instance of the EventItem class with the following values:
o EventKey: "FY17SepGeneralConference"
o StartTime: DateTime.Today
o EndTime: DateTime.Today.AddDays(3d)
o Title: "FY17 September Technical Conference"
o Description: "Sed in euismod mi."
o RegistrationCount: 1
4. At the end of the Seed method, add the newly created EventItem to the context.Events collection.
5. At the end of the Seed method, create an instanced of the Registration class with the following
values:
o EventKey: "FY17SepGeneralConference"
o FirstName: "Aisha"
o LastName: "Witt"
6. At the end of the Seed method, add the newly created Registration to the context.Registrations
collection.
Task 4: Publish the Cloud Application with the Updated DbContext to Azure
1. Update the Web.Release.config file in the Contoso.Events.Web project to use a connection string
to your Azure SQL Database.
2. Publish the Contoso.Events.Cloud project to a new Cloud Service project with the following details:
o Name: cs20532a[Your Name Here]
o Environment: Production
o Build configuration: Release
Task 5: Verify that the Azure Cloud Service Website is using the New Data
1. View the website for your published Cloud Service.
Task 7: View the Migrated Data in the Azure SQL Management Portal
1. View the list of SQL Databases for your subscription.
3. Log in to the Management Portal for your SQL Database with these values:
o Username: testuser
o Password: TestPa$$w0rd
Results: After completing this exercise, you will be able to configure Entity Framework to initialize a new
database with seed data.
Question: What are some scenarios where it is appropriate to use Seed data from a ORM
framework in your Azure SQL Database?
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 7-17
Lesson 6
Azure Storage Overview
Azure Storage allows you to store unstructured data, files and messages. Azure Storage can be used as a
shared resource to your cloud applications and the various instances of each service.
Lesson Objectives
After completing this lesson, you will be able to:
Azure Storage
Types of Storage
MCT USE ONLY. STUDENT USE PROHIBITED
7-18 Storing Tabular Data in Azure
Lesson 7
Azure Storage Tables Overview
Table Storage provides a non-relational database option for storage in Azure. It has been tuned to scale
to very large quantities of entities and even operations per second. Simply, Table Storage was built with
scalability in mind.
This lesson will introduce the Table Storage service and describe why it is unique.
Lesson Objectives
After completing this lesson, you will be able to:
Storage Tables
Lesson 8
Table Entity Transactions
Storage Tables offers a set of transactional functionality that mirrors the traditional
Create/Read/Update/Delete (CRUD) methods. Storage Tables also leverages the OData protocol for
queries.
This lesson will describe both common transactions and entity ingress considerations for Storage Tables
and their entities.
Lesson Objectives
After completing this lesson, you will be able to:
Common Transactions
OData Queries
MCT USE ONLY. STUDENT USE PROHIBITED
7-22 Storing Tabular Data in Azure
Prepend/Append Problem
• Prior to starting this lab, you must have completed the labs in Modules 2 and 3.
1. On the host computer, click Start, type Remote, and then click Remote Desktop Connection.
2. In Remote Desktop Connection, provide the name of your virtual machine in the Computer dialog
box using this format:
vm20532a[Your Name Here].cloudapp.net:[Your VM RDP Port]
Note: The name and port for your VM may already be saved in the drop-down list when
selecting a Computer. If this is the case, use this value instead of typing it in manually. If you are
unsure about your VM’s RDP port, use either of the Azure portal to look up your VM’s endpoints.
The endpoint with the name Remote Desktop is the correct port for RDP. This port is
randomized to protect your VM from unauthorized access.
3. In Remote Desktop Connection, click Connect. Wait until the RDP client accesses the virtual machine.
o Password: TestPa$$w0rd
5. Verify that you received credentials to log into the Azure portal from you training provider, these
credentials and the Azure account will be used throughout the labs of this course.
Demonstration Steps
1. Create a new Console Application project in Visual Studio 2013:
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 7-23
o Name: Contoso.Storage.Table
2. Add the WCF Data Services Client for OData v1-3 NuGet package using the Package Manager
Console:
o Version: 5.6.0
3. Add the Windows Azure Storage NuGet package using the Package Manager Console:
o Version: 3.1.0.1
CloudTableClient tableClient =
CloudStorageAccount.DevelopmentStorageAccount.CreateCloudTableClient();
table.CreateIfNotExists();
12. Update the Employee class to inherit from the TableEntity class.
13. Add a YearsAtCompany public property of type int with both get and set accessors;
14. Override the ToString method of the Object base class and add this code:
15. In the Program class at the end of the Main method, create three employees using the following
code:
16. Insert the employee with the IT partition key to the Table using the following code:
table.Execute(insertOperation);
17. Batch insert the employees with the HR partition key to the Table using the following code:
Note: Batch operations can be used to insert multiple entities into an Azure Storage
table. The entities must all have the same PartitionKey in order to be inserted as a single batch.
18. Query the table for employees with a partition key equal to HR and print them to the console using
the following code:
19. Retrieve the single employee with a partition key of IT and a row key of ibahena and print the
employee to the console using the following code:
Console.WriteLine("\n\n\n\nIT Employee\n");
TableOperation retrieveOperation = TableOperation.Retrieve<Employee>("IT",
"ibahena");
TableResult result = table.Execute(retrieveOperation);
Employee itEmployee = result.Result as Employee;
Console.WriteLine(itEmployee);
Objectives
After you complete this lab, you will be able to:
• Use Server Explorer in Visual Studio 2013 to view Table Storage entities.
1. On the host computer, click Start, type Remote, and then click Remote Desktop Connection.
2. In Remote Desktop Connection, provide the name of your virtual machine in the Computer dialog
box using this format:
vm20532a[Your Name Here].cloudapp.net:[Your VM RDP Port]
Note: The name and port for your VM may already be saved in the drop-down list when
selecting a Computer. If this is the case, use this value instead of typing it in manually. If you are
unsure about your VM’s RDP port, use either of the Azure portal to look up your VM’s endpoints.
The endpoint with the name Remote Desktop is the correct port for RDP. This port is
randomized to protect your VM from unauthorized access.
3. In Remote Desktop Connection, click Connect. Wait until the RDP client accesses the virtual machine.
o Password: TestPa$$w0rd
5. Verify that you received credentials to log into the Azure portal from you training provider, these
credentials and the Azure account will be used throughout the labs of this course.
4. Using the _tableClient variable, Create a new CloudTable instance using the GetTableReference
method with the following parameters:
o tableName: EventRegistrations
2. Create a TableQuery with the filter and execute the query using the ExecuteQuery method of the
table variable using the following code:
Note: You can alternatively use the query syntax for LINQ-to-Objects:
Results: After completing this exercise, you will be able to query entities by row key or partition key from
Table Storage.
2. Update the Register ViewModel to Retrieve the Dynamic Stub Registration from the Table
Task 1: Update the Register Controller Action to Store the Registration Record
1. Open the RegisterController.cs file in the Contoso.Events.Web project.
2. Remove the existing code from the StoreRegistration method.
string connectionString =
CloudConfigurationManager.GetSetting("Microsoft.WindowsAzure.Storage.ConnectionString
");
var storageAccount =
Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(connectionString);
4. Create a CloudTable variable using the storage account and a Storage table named
EventRegistrations using the following code:
5. Create and execute a TableOperation to insert the dynamic registration object into the Storage table
using the following code:
6. Parse the RowKey of the registration as a System.Guid and return the value as the result of the
StoreRegistration method using the following code:
return Guid.Parse(registration.RowKey);
Task 2: Update the Register ViewModel to Retrieve the Dynamic Stub Registration
from the Table
1. Open the RegisterViewModel.cs file in the Contoso.Events.ViewModels project.
string connectionString =
CloudConfigurationManager.GetSetting("Microsoft.WindowsAzure.Storage.ConnectionString
");
var storageAccount =
Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(connectionString);
4. Create a CloudTable variable using the storage account and a Storage table named
EventRegistrations using the following code:
5. Create a string filter that finds entities with a PartitionKey equivalent to the eventKey provided by
the GetRegistrantsNames method’s parameters using the following code:
6. Create a TableQuery with the filter and execute the query using the ExecuteQuery method of the
table variable using the following code:
7. Since the query will only return a single entity, use the SingleOrDefault extension method to get the
DynamicTableEntity variable and then pass that variable into the
DynamicEntity.GenerateDynamicItem static method. Set the RegisterViewModel’s
RegistrationStub property to the result of the method call using the following code:
Results: After completing this exercise, you will be able to use the Azure Storage SDK to retrieve and
create entities.
Exercise 3: Verify that the Events Web Site is using Azure Storage Tables
for Registrations
Scenario
In this exercise you will:
1. Run the Data Generation Console Project to Populate the Azure Storage Table with Data
2. Use Server Explorer in Visual Studio 2013 to View Table Storage Registrations
Task 1: Run the Data Generation Console Project to Populate the Azure Storage
Table with Data
1. Locate the Contoso.Events.Data.Generation project.
Task 2: Use Server Explorer in Visual Studio 2013 to View Table Storage Registrations
1. Open the Windows Azure node of the Server Explorer pane.
Task 3: Debug the Cloud Web Project to Register for the Event
1. Debug the Contoso.Events.Cloud cloud project.
Task 4: Use Server Explorer in Visual Studio 2013 to View the New Table Storage
Registration
1. Switch to the Contoso.Events - Visual Studio 2013 window
Results: After completing this exercise, you will be able to leverage Visual Studio and the Azure emulators
to create a comprehensive development environment for Azure Storage.
Question: Since the Azure Storage SDK shares a CloudStorageAccount class that is used for
all types of storage, what are some of the ways that you can refactor your application to take
advantage of this?
MCT USE ONLY. STUDENT USE PROHIBITED
7-30 Storing Tabular Data in Azure
Azure SQL Databases provides a service offering for relational databases. It was built for the highest level
of compatibility with the existing management tools and SSDT features in Visual Studio 2013. Leveraging
Entity Framework allows you to write your code once and rely on configuration changes to point your
ORM at the right database depending on your environment.
Review Question(s)
Question: When implementing database “sharding”, why is the federation distribution key
important? How does this key help drive performance?
MCT USE ONLY. STUDENT USE PROHIBITED
8-1
Module 8
Storing Files and Media in Azure
Contents:
Module Overview 8-1
Module Overview
When scaling to many different cloud instances, storing files to a local disk becomes a difficult process to
maintain and an unreliable method of storage. Azure provides a Blob Storage mechanism that offers high
performance and supports Content Delivery Network (CDN) integration for low latency downloads.
Lesson 1, “Azure Blob Storage”, describes the Azure Blob service and the types of blobs supported. Lesson
2, “Blob Storage Permissions”, details the ways that you can secure and grant temporary access to blobs or
containers. Lesson 3, “Azure Storage SDK”, describes the .NET libraries that can be used for Azure Storage
Blobs. Lesson 4, “Blob Storage Internals”, describes monitoring, metrics and the emulator.
Objectives
After completing this module, you will be able to:
Lesson 1
Azure Storage Blobs
Blob Storage provides a file and data storage mechanism in Azure. It is designed for speed and
convenience and also supports a CDN option.
This lesson will introduce the Blob Storage service and its basic concepts.
Lesson Objectives
After completing this lesson, you will be able to:
Blob Storage
Blob Types
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 8-3
Lesson 2
Controlling Access to Storage Blobs & Containers
Sometimes files need to be secured so they cannot be accessed anonymously. Azure Storage Blobs
contain a mechanism for securing blobs and granting temporary access using query string tokens.
This lesson will introduces the concept of blob permissions and Shared Access Signature tokens.
Lesson Objectives
After completing this lesson, you will be able to:
• Create a Shared Access Policy that can be used to generate SAS tokens.
Container Permissions
Blob Permissions
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 8-5
Lesson 3
Monitoring Storage Blobs
Just like with other Azure Storage types, monitoring the account and testing in the emulator are
important to understand the behavior of your application.
This lesson will detail the monitoring options available for Azure Storage Blobs and the emulator
implementation.
Lesson Objectives
After completing this lesson, you will be able to:
Lesson 4
Configuring Azure Storage Accounts
Azure Storage Accounts can have additional features enabled or configured to extend the base
functionality.
This lesson introduces the CDN and CORS features for a Storage Account.
Lesson Objectives
After completing this lesson, you will be able to:
Lesson 5
Azure Files
Azure Files is a service that provides an SMB file share that can be used to share files among multiple
virtual machines.
This lesson describes the Azure Files service and the File Share logical unit.
Lesson Objectives
After completing this lesson, you will be able to:
File Shares
MCT USE ONLY. STUDENT USE PROHIBITED
8-10 Storing Files and Media in Azure
Lesson 6
Uploading and Migrating Storage Data
Storage accounts would be useless if we could not populate them with files. The various client libraries
and management tools for Azure provides a wealth of options to assist in the ingress of new files into a
Storage Account.
This lesson will cover the Async Blob Copy and migration strategies for Azure Storage Blobs and Azure
Files.
Lesson Objectives
After completing this lesson, you will be able to:
• Use Async Blob Copy to create a job for duplicating blobs between storage accounts
• Describe strategies for uploading files to Azure Storage Blobs or Azure Files
Objectives
After you complete this lab, you will be able to:
For this lab, you will use the available host machine. Before you begin this lab, you must complete the
following steps:
• Prior to starting this lab, you must have completed the labs in Modules 2 and 3.
1. On the host computer, click Start, type Remote, and then click Remote Desktop Connection.
2. In Remote Desktop Connection, provide the name of your virtual machine in the Computer dialog
box using this format:
vm20532a[Your Name Here].cloudapp.net:[Your VM RDP Port]
Note: The name and port for your VM may already be saved in the drop-down list when
selecting a Computer. If this is the case, use this value instead of typing it in manually. If you are
unsure about your VM’s RDP port, use either of the Azure portal to look up your VM’s endpoints.
The endpoint with the name Remote Desktop is the correct port for RDP. This port is
randomized to protect your VM from unauthorized access.
3. In Remote Desktop Connection, click Connect. Wait until the RDP client accesses the virtual machine.
o Name: example
o Access Type: Container
4. In the Container tab, upload the sample file located at the following location:
Results: After completing this exercise, you will be able to create a blob container using the Management
Portal and view blobs in the container.
• Use the Azure Storage SDK to access blobs in your storage account.
• Use the Azure Storage SDK to create blobs in your storage account.
The main tasks for this exercise are as follows:
Task 1: Open the Blob Helper in the Cloud Service Worker Project
1. Open the Contoso.Events solution from the following location:
Task 2: Add Word Documents to the Container After They are Created
1. Remove the existing code from the CreateBlob method.
2. Create a CloudBlobContainer variable for the signin container and ensure that the container exists
using the following code:
3. Create a name for your blob using the following format “{eventKey}_SignIn_{date}”.
4. Create a blob reference using the new blobName, seek the MemoryStream back to the beginning
and upload the stream to the blob using the UploadFromStream method using the following code:
Results: After completing this exercise, you will be able to use the Azure Storage SDK to manage blobs
and containers in your storage account.
4. Create a blob reference using the new blobName and use the OpenReadAsync method to create a
Stream variable using the following code:
5. Return a new instance of the DownloadPayload class assigning the Stream variable to the
DownloadPayload.Stream property and the ICloudBlob variable’s Properties.ContentType value
for the DownloadPayload.ContentType property.
2. After the Contoso Events (Contoso.Events.Cloud) website is open, use IIS Express to open the
Contoso.Events.Management website.
3. In the Administration web application, choose any event, generate a sign-in sheet and download the
sign-in sheet.
Note: Currently, the web applications gets a Stream of the blob and uses MVC’s File helper to
return the file to the user. The implementation is available to view in the DownloadSignIn method
of the HomeController class in the Contoso.Events.Management project.
Results: After completing this exercise, you will be able to download blobs from your storage account
using the Azure Storage SDK.
4. Create a new instance of the SharedAccessBlobPolicy class, set the expiry time to 15 minutes from
the current time and set the blob permission to read using the following code:
5. Create a new instance of the BlobContainerPermissions class, add the newly created
SharedAccessBlobPolicy with the name “ReadBlobPolicy” and disable public access using the
following code:
await container.SetPermissionsAsync(blobPermissions);
string sasToken = container.GetSharedAccessSignature(new SharedAccessBlobPolicy(),
"ReadBlobPolicy");
7. Create a blob reference using the _blobId variable then store the Blob’s Uri in a Uri variable using the
following code:
8. Concatenate the Uri variable’s AbsoluteUri property with the sasToken concatenated and return the
new string as the result of the method.
Task 3: Download Documents from a Protected Container using the SAS Token
1. Debug the solution.
2. After the Contoso Events (Contoso.Events.Cloud) website is open, use IIS Express to open the
Contoso.Events.Management website.
3. In the Administration web application, choose any event, generate a sign-in sheet and download the
sign-in sheet.
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 8-17
Note: You can always look at Internet Explorer’s download manager if you want to see the full
URL used (with SAS Token) to download the file.
Results: After completing this exercise, you will be able to modify the permissions of containers and
generate SAS Tokens for the containers.
Question: Your server application needs to generate a Shared Access Signature for the client
to download a subset of blobs in a single container. Should you give the signature read
access to the container or read access to the individual blobs?
MCT USE ONLY. STUDENT USE PROHIBITED
8-18 Storing Files and Media in Azure
Review Question(s)
Question: You have a web application that allows your end-users to download a large blob
that is protected. Your server-side logic generates a SAS token to retrieve the protected
blob. Should your server download the blob and stream it to the web client or should your
server provide the Blob Url with the appended SAS token to the web client?
MCT USE ONLY. STUDENT USE PROHIBITED
9-1
Module 9
Designing a Communication Strategy using Queues and
Service Bus
Contents:
Module Overview 9-1
Module Overview
With web applications presenting content and worker roles processing logic, there needs to be a
mechanism to communicate between these different entities. Azure provides two queuing mechanisms
that can be used for this purpose. Lesson 1, “Queue Mechanisms in Azure” introduces the Azure Storage
Queues and Service Bus Queues. Lesson 2, “Azure Storage Queues”, introduces the queue mechanism
available in Azure Storage accounts. Lesson 3, “Using the Azure Storage SDK to Manage Storage Queues”,
describes the classes and methods that can be used to interact with queues. Lesson 4, “Monitoring Queue
Storage”, details how you can use Visual Studio to view queue data in an Azure Storage account. Lesson
5, “What is Azure Service Bus?”, introduces the Service Bus offering in Azure. Lesson 6, “Azure Service Bus
Queues”, describes the queuing mechanism available in Service Bus and the difference between that and
Azure Storage Queues. Lesson 7, “Using the Azure Service Bus SDK to Manage Service Bus Queues”,
details how you can use the classes and methods available in the SDK to manage Service Bus Queues.
Objectives
After completing this module, you will be able to:
• Describe Azure Storage Queues.
Lesson 1
Queue Mechanisms in Azure
There are multiple ways to queue messages that need to be sent to workers or other services in Azure.
This lesson will introduce the Azure Storage and Service Bus queues.
Lesson Objectives
After completing this lesson, you will be able to:
Lesson 2
Azure Storage Queues
Azure Storage Queues provide a consistent and reliable way to store messages that can be consumed by
multiple workers.
This lesson will introduce the Azure Storage Queues service and describe some of its characteristics.
Lesson Objectives
After completing this lesson, you will be able to:
• Describe the characteristics of the Storage Queues in the Azure Storage Emulator.
REST API
MCT USE ONLY. STUDENT USE PROHIBITED
9-4 Designing a Communication Strategy using Queues and Service Bus
Lesson 3
Handling Storage Queue Messages
The key to managing Storage Queues is understanding and handling messages.
Lesson Objectives
After completing this lesson, you will be able to:
Message Characteristics
Message Operations
MCT USE ONLY. STUDENT USE PROHIBITED
9-6 Designing a Communication Strategy using Queues and Service Bus
Lesson 4
Azure Service Bus
Service Bus is a fully managed messaging platform in Azure. Components of your application can
leverage Service Bus to share messages in a disconnected manner.
Lesson Objectives
After completing this lesson, you will be able to:
Namespaces
MCT USE ONLY. STUDENT USE PROHIBITED
9-8 Designing a Communication Strategy using Queues and Service Bus
Lesson 5
Azure Service Bus Queues
Service Bus provides queue functionality that can be used to marshal messages from reporting
applications to consuming applications. The Service Bus Queue is different than the Azure Storage
Queues.
This lesson will describe the Service Bus Queues and describe the difference between these queues and
Azure Storage Queues.
Lesson Objectives
After completing this lesson, you will be able to:
Lesson 6
Azure Service Bus Relay
Service Bus Relays provide a flexible way to connect WCF services and clients without having to redesign
the network architecture in your organization. By connecting the WCF service to the relay in an outgoing
manner, you clients only need to be able to connect to the Service Bus endpoint in Azure to be able to
communicate with your WCF service.
This lesson will describe the benefits and architecture of Service Bus Relays.
Lesson Objectives
After completing this lesson, you will be able to:
Management Credentials
Lesson 7
Azure Service Bus Notification Hubs
Notification Hubs provides a simple interface for a highly-scalable managed mobile push notification
platform. Using Notification Hubs, an application can send template or personalized notifications across a
variety of mobile platforms.
This lesson describes the Notification Hubs service and the methods of integrating with the service.
Lesson Objectives
After completing this lesson, you will be able to:
• Register a client device to a Notification Hub from either the client or service application
Registrations
Currently, your on premise Contoso Events application uses a WCF service to list the hotels that are near a
location. You would like to continue to use the WCF service, but you cannot modify your company’s
firewall. You also would not like to expose the true network location of the WCF service. You have
decided to use Service Bus Relays so that you have a common endpoint that you can provide to client
applications. You will start by using that endpoint in your Contoso Events web application.
Objectives
After you complete this lab, you will be able to:
• Create a Service Bus Namespace using the Management Portal.
• Modify the XML configuration of a WCF service to use the Service Bus Relay bindings.
• Modify the C# configuration of a WCF client to use the Service Bus Relay bindings.
Estimated Time: 90 minutes
For this lab, you will use the available host machine. Before you begin this lab, you must complete the
following steps:
• Prior to starting this lab, you must have completed the labs in Modules 2 and 3.
1. On the host computer, click Start, type Remote, and then click Remote Desktop Connection.
2. In Remote Desktop Connection, provide the name of your virtual machine in the Computer dialog
box using this format:
vm20532a[Your Name Here].cloudapp.net:[Your VM RDP Port]
Note: The name and port for your VM may already be saved in the drop-down list when
selecting a Computer. If this is the case, use this value instead of typing it in manually. If you are
unsure about your VM’s RDP port, use either of the Azure portal to look up your VM’s endpoints.
The endpoint with the name Remote Desktop is the correct port for RDP. This port is
randomized to protect your VM from unauthorized access.
3. In Remote Desktop Connection, click Connect. Wait until the RDP client accesses the virtual machine.
o Password: TestPa$$w0rd
5. Verify that you received credentials to log into the Azure portal from you training provider, these
credentials and the Azure account will be used throughout the labs of this course.
Task 1: Create the Service Bus Namespace using the Management Portal
Note: Service Bus functionality is not available yet in the new Preview Portal. Because of
this, the existing Management Portal will be used for this lab.
Results: After completing this exercise, you will be able to create a Service Bus Namespace using the
Azure Management Portal.
3. In the TableStorageQueueHelper constructor get the Queue Client and name of the queue using
the following code:
6. Get the CloudQueueMessage variable by calling the GetMessage method of the CloudQueue class
and pass the message variable into the constructor of the TableStorageQueueMessage class using
the following code:
7. In the CompleteMessage method, create a new CloudQueue instance and ensure that the instance
exists using the following code:
8. Call the DeleteMessage method of the CloudQueue class with the CloudQueueMessage variable as
the first parameter using the following code:
queue.DeleteMessage(message);
CloudStorageAccount storageAccount =
CloudStorageAccount.Parse(tableStorageConnectionString);
CloudQueueClient queueClient = storageAccount.CreateCloudQueueClient();
3. Using the SignQueueName cloud setting value, create a new CloudQueue instance and ensure that
the instance exists using the following code:
queue.CreateIfNotExists();
4. Add the message to the queue by creating a new instance of the CloudQueueMessage class using
the string message as the constructor parameter and adding the new instance with the CloudQueue
AddMessage method using the following code:
Note: You should configure the solution to launch the Contoso.Events.Cloud project in
debug and simply launch the Contoso.Events.Management project without debugging.
2. After the Contoso Events (Contoso.Events.Cloud) website is open, use IIS Express to open the
Contoso.Events.Administration website.
HandleMessage(message);
Results: After completing this exercise, you will be able to create and consume messages from Azure
Storage Queues.
2. Name: Microsoft.ServiceBus.ConnectionString
3. Value: [Your Service Bus Connection String]
5. In the ServiceBusQueueHelper constructor get the Queue Client using the following code:
string serviceBusConnectionString =
CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
string signInQueueName = CloudConfigurationManager.GetSetting("SignInQueueName");
_client = QueueClient.CreateFromConnectionString(serviceBusConnectionString,
signInQueueName);
7. Invoke the Receive method of the QueueClient class, store the result in a BrokeredMessage and
pass the new variable into the ServiceBusQueueMessage constructor using the following code:
message.Complete();
message.Abandon();
o Key: Microsoft.ServiceBus.ConnectionString
4. Replace the above line of code with the following line of code:
QueueClient client =
QueueClient.CreateFromConnectionString(serviceBusConnectionString, signInQueueName);
6. Add the message to the queue by creating a new instance of the BrokeredMessage class using the
QueueMessage message as the constructor parameter and adding the new instance with the
QueueClient Send method using the following code:
HandleMessage(message);
7. In the Administration web application, choose any event, generate a sign-in sheet and download the
sign-in sheet.
Results: After completing this exercise, you will be able to create and consume messages from Azure
Storage Queues.
Exercise 4: Use Service Bus Relay to Connect a WCF Service and Client[s]
Scenario
In this exercise you will:
• Manage the XML configuration for a WCF service.
MCT USE ONLY. STUDENT USE PROHIBITED
9-20 Designing a Communication Strategy using Queues and Service Bus
4. Updating the Cloud Web Application to Connect to the Relayed WCF Service
5. Debug the Cloud Web Application
Task 2: Modify the WCF Service Endpoints to use Service Bus Relay
1. Switch back to the Contoso.Events - Visual Studio 2013 window.
o sb://[namespace].servicebus.windows.net/lodging
<behavior name="ServiceBusRelayBehavior">
<transportClientEndpointBehavior>
<tokenProvider>
<sharedSecret issuerName="owner" issuerSecret="[key]" />
</tokenProvider>
</transportClientEndpointBehavior>
</behavior>
6. Locate the issuerSecret attribute in the sharedSecret element and replace it with your previously
recorded Default Key.
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 9-21
Task 4: Updating the Cloud Web Application to Connect to the Relayed WCF Service
1. Copy the GetHotels method from the Program.cs file.
2. Switch back to the Contoso.Events - Visual Studio 2013 window and stop debugging.
3. Open the HotelsViewModel.cs file in the Contoso.Events.ViewModels project.
4. Replace the GetHotels method that returned an empty Enumerable with your copied method.
o Contoso.Events.Management: None
2. Debug the Contoso.Events.Data.Generation project to generate the SQL and Azure Storage Tables
data.
Results: After completing this exercise, you will be able to connect existing WCF applications to clients
using Service Bus Relay.
Question: What are some of the ways that you can automate the change of your WCF
bindings from their on premise versions to a Service Bus Relay binding after the projects are
published?
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 9-23
Review Question(s)
Question: Which Queuing mechanism is better suited for massive amounts of messages?
Question: If you have an application that cannot afford to lose any messages, should you
use PeekLock or ReceiveAndDelete mode in your consuming client? How do you check to
see if the message is a duplicate?
Question: If you have a weather app, use Notification Hubs for messaging and you would
like to let people within a specific zip code receive an emergency alert for a hurricane, how
would you architect your application to support this?
MCT USE ONLY. STUDENT USE PROHIBITED
9-24 Designing a Communication Strategy using Queues and Service Bus
MCT USE ONLY. STUDENT USE PROHIBITED
10-1
Module 10
Automating Integration with Azure Resources
Contents:
Module Overview 10-1
Module Overview
While many of the Azure service can be managed using the portals and Visual Studio, scripting can be
used to completely automate the management of the same resources. As part of managing Azure
resources, this module will look at automating the services’ lifecycles using Client Libraries, PowerShell,
REST and the Resource Manager. Lesson 1, “Azure SDK Client Libraries”, briefly looks at the client libraries
available for managing and interacting with Azure services. Lesson 2, “Scripting Azure Service
Management using PowerShell”, describes the modules available for managing services using the
traditional methods or the Resource Manager using Azure PowerShell cmdLets. Lesson 3, “Azure REST
Interface”, introduces and briefly describes the Service Management API. Lesson 4, “Resource Manager”,
discusses the new Resource Manager in Azure and the concepts associated with the new method of
managing resources.
Objectives
After completing this module, you will be able to:
• Describe the Azure SDKs and client libraries.
• Describe the Service Management API and how to authenticate to the API.
• Use the Resource Manager to create resource groups and templates.
MCT USE ONLY. STUDENT USE PROHIBITED
10-2 Automating Integration with Azure Resources
Lesson 1
Azure SDK Client Libraries
Client Libraries are available for a variety of platforms to manage Azure services and create constructs
within existing services.
This lesson will list the SDKs available and how they are used to manage Azure services.
Lesson Objectives
After completing this lesson, you will be able to:
Azure SDKs
Cloud Services
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 10-3
Lesson 2
Scripting Azure Service Management using PowerShell
PowerShell can be used to automate many of the administration that IT Pros perform on a daily basis. For
developers, PowerShell can be used to facilitate and automate many of their DevOps responsibilities.
This lesson will describe the two sets of CmdLets available in Azure PowerShell.
Lesson Objectives
After completing this lesson, you will be able to:
1. On the host computer, click Start, type Remote, and then click Remote Desktop Connection.
2. In Remote Desktop Connection, provide the name of your virtual machine in the Computer dialog
box using this format:
vm20532a[Your Name Here].cloudapp.net:[Your VM RDP Port]
Note: The name and port for your VM may already be saved in the drop-down list when
selecting a Computer. If this is the case, use this value instead of typing it in manually. If you are
unsure about your VM’s RDP port, use either of the Azure portal to look up your VM’s endpoints.
The endpoint with the name Remote Desktop is the correct port for RDP. This port is
randomized to protect your VM from unauthorized access.
3. In Remote Desktop Connection, click Connect. Wait until the RDP client accesses the virtual machine.
4. If necessary, sign in using the following credentials:
• Password: TestPa$$w0rd
5. Verify that you received credentials to log into the Azure portal from you training provider, these
credentials and the Azure account will be used throughout the labs of this course.
Demonstration Steps
1. Download and run the Azure PowerShell installation executable.
• Url: http://go.microsoft.com/fwlink/p/?linkid=320376
Add-AzureAccount
Get-AzureAccount
6. Authenticate to Azure by downloading and saving the Publish Settings file using the following
command and details:
Get-AzurePublishSettingsFile
Import-AzurePublishSettingsFile E:\Mod10\Demofiles\20532.publishsettings
Get-AzureAccount
Get-AzureWebsite
Get-AzureWebsite
Lesson 3
Azure REST Interface
Many modern services and applications provide REST APIs. HTTP is a universal standard and can be used
across a variety of platforms and languages. Azure provides a Service Management API that can be used
to manage services regardless of your current platform.
This lesson will describe the Service Management API and how to authenticate against the API.
Lesson Objectives
After completing this lesson, you will be able to:
Lesson 4
Azure Resource Manager
With the new Preview Portal (Ibiza), a new way of managing resources in Azure has emerged. With
resource groups and resource group templates, automating the creation and monitoring of multiple-
service workloads has been made much easier.
Lesson Objectives
After completing this lesson, you will be able to:
• Use the Resource Manager to create multiple resources as a single managed unit.
Resource Groups
MCT USE ONLY. STUDENT USE PROHIBITED
10-8 Automating Integration with Azure Resources
• Prior to starting this lab, you must have completed the labs in Modules 2 and 3.
1. On the host computer, click Start, type Remote, and then click Remote Desktop Connection.
2. In Remote Desktop Connection, provide the name of your virtual machine in the Computer dialog
box using this format:
vm20532a[Your Name Here].cloudapp.net:[Your VM RDP Port]
Note: The name and port for your VM may already be saved in the drop-down list when
selecting a Computer. If this is the case, use this value instead of typing it in manually. If you are
unsure about your VM’s RDP port, use either of the Azure portal to look up your VM’s endpoints.
The endpoint with the name Remote Desktop is the correct port for RDP. This port is
randomized to protect your VM from unauthorized access.
3. In Remote Desktop Connection, click Connect. Wait until the RDP client accesses the virtual machine.
• Password: TestPa$$w0rd
5. Verify that you received credentials to log into the Azure portal from you training provider, these
credentials and the Azure account will be used throughout the labs of this course.
Demonstration Steps
1. Open the Windows Azure PowerShell application.
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 10-9
Switch-AzureMode AzureResourceManager
Add-AzureAccount
4. View the list of Resource Gallery Templates available for your subscription:
Get-AzureResourceGroupGalleryTemplate
Get-AzureResourceGroupGalleryTemplate -Identity
MSOpenTech.OracleDB12cWebLogicServer12cStand.0.2.0-preview
Save-AzureResourceGroupGalleryTemplate -Identity
MSOpenTech.OracleDB12cWebLogicServer12cStand.0.2.0-preview -Path E:\Mod10\Demofiles
• Prior to starting this lab, you must have completed the labs in Modules 2 and 3.
1. On the host computer, click Start, type Remote, and then click Remote Desktop Connection.
2. In Remote Desktop Connection, provide the name of your virtual machine in the Computer dialog
box using this format:
vm20532a[Your Name Here].cloudapp.net:[Your VM RDP Port]
Note: The name and port for your VM may already be saved in the drop-down list when
selecting a Computer. If this is the case, use this value instead of typing it in manually. If you are
unsure about your VM’s RDP port, use either of the Azure portal to look up your VM’s endpoints.
The endpoint with the name Remote Desktop is the correct port for RDP. This port is
randomized to protect your VM from unauthorized access.
3. In Remote Desktop Connection, click Connect. Wait until the RDP client accesses the virtual machine.
4. If necessary, sign in using the following credentials:
• User name: testuser
• Password: TestPa$$w0rd
5. Verify that you received credentials to log into the Azure portal from you training provider, these
credentials and the Azure account will be used throughout the labs of this course.
2. Authenticate to Azure by downloading and saving the Publish Settings file using the following
command and details:
Get-AzurePublishSettingsFile
• Directory: E:\Mod10\Labfiles
3. Authenticate to Azure by importing the saved Publish Settings file:
Import-AzurePublishSettingsFile E:\Mod10\Labfiles\20532.publishsettings
Get-AzureAccount
Note: If you have multiple Azure subscriptions, you can use Select-AzureSubscription to
select the correct subscription to use. If your Azure subscription was provided by a Learning
Partner it may be an auto-generated account without any “details”. In this case, this command
would return an empty result.
Results: After completing this exercise, you will be able to setup a development environment to use
PowerShell for Azure service automation.
Get-AzureWebsite
Get-AzureWebsite
Results: After completing this exercise, you will be able to use PowerShell to manage instances of an
Azure service.
Switch-AzureMode AzureResourceManager
Add-AzureAccount
Get-AzureAccount
Note: If you have multiple Azure subscriptions, you can use Select-AzureSubscription to
select the correct subscription to use.
• siteLocation: West US
• serverName: rv20532a[Your Name Here]
• serverLocation: West US
• administratorLogin: testuser
• administratorLoginPassword: TestPa$$w0rd
MCT USE ONLY. STUDENT USE PROHIBITED
10-14 Automating Integration with Azure Resources
Note: Please wait for the provisioning process to complete. Status messages will be
displayed periodically and a final details message will be shown when provisioning is complete.
4. View the details for your newly created Website in your Resource Group:
5. Record the single value in the hostNames array from your new website’s details.
6. View the newly created Website:
Note: Since removing a Resource Group involves removing multiple resources, this
process can take anywhere from 10-15 minutes.
Results: After completing this exercise, you will be able to use Azure to interact with the Resource
Manager, resource groups and resource group templates.
Lab Review
Test Your Knowledge
Question
Which Azure cmdLet can be used to verify that a Resource Group has been deleted?
Remove-AzureResourceGroup
Get-AzureResourceStatus
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 10-15
Question
Get-AzureResourceGroup
Delete-AzureResourceGroup
Get-AzureResourceGroupTemplate
Question: When automating your Azure accounts and resource management, should you
use the Resource Manager cmdLets or the standard cmdLets?
MCT USE ONLY. STUDENT USE PROHIBITED
10-16 Automating Integration with Azure Resources
Best Practice: Moving forward, the Azure Resource Manager is the preferred method of
managing resources in Azure. Resource should be grouped into logical units using resource
groups and templates should be created for resources that may need to be created multiple
times.
Review Question(s)
Question: When automating the creation of a group of Azure service instances, would your
choose to use the standard PowerShell modules or the new Resource Manager modules?
What factors would drive your decision?
Question: How could you create your own Resource Group template?
MCT USE ONLY. STUDENT USE PROHIBITED
11-1
Module 11
Implementing Security in Web Applications using Azure
Contents:
Module Overview 11-1
Module Overview
Just like applications on premise, applications in the cloud need streamlined security mechanisms that are
flexible. One of the greatest benefits of Azure Active Directory is that it can be extended with optional
services and even code in your projects. Azure AD Access Control Services even allows you to integrate
third-party identity providers. Lesson 1, “Azure Active Directory”, introduces the Azure Active Directory
service offering. Lesson 2, “Azure AD Directories”, details how to create a directory in Azure AD. Lesson 3,
“Azure AD Access Control Service”, describes the ACS functionality and how it can be used to integrate
your application with third-party identity providers. Lesson 4, “Azure AD Multi-Factor Authentication”,
describes the MFA features in Azure AD.
Objectives
After completing this module, you will be able to:
Lesson 1
Azure Active Directory
Azure Active Directory provides a suite of services that can be integrated with custom applications, on
premise machines, existing domains and even third party services.
This lesson will describe the Azure Active Directory service and its features and benefits.
Lesson Objectives
After completing this lesson, you will be able to:
Benefits of AD in Azure
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 11-3
Azure AD Services
MCT USE ONLY. STUDENT USE PROHIBITED
11-4 Implementing Security in Web Applications using Azure
Lesson 2
Azure AD Directories
Azure AD Directories provide a logical way to group your users and applications.
This lesson introduces directories and details the different components and integrations available.
Lesson Objectives
After completing this lesson, you will be able to:
Applications in Azure AD
Azure AD Graph
MCT USE ONLY. STUDENT USE PROHIBITED
11-6 Implementing Security in Web Applications using Azure
Lesson 3
Azure AD Access Control Service
Access Control Services provides an identity integration solution that allows you to enable multiple
identity providers and map their claims to common claims that you can use in your application. This cuts
down greatly on the amount of custom code you need to write in your application for each identity
provider.
Lesson Objectives
After completing this lesson, you will be able to:
Lesson 4
Azure AD Multi-Factor Authentication
Multi-Factor Authentication is a feature in Azure AD that can be used to provide MFA capabilities to your
existing directory accounts.
Lesson Objectives
After completing this lesson, you will be able to:
Multi-Factor Authentication
Objectives
After you complete this lab, you will be able to:
For this lab, you will use the available host machine. Before you begin this lab, you must complete the
following steps:
• Prior to starting this lab, you must have completed the labs in Modules 2 and 3.
1. On the host computer, click Start, type Remote, and then click Remote Desktop Connection.
2. In Remote Desktop Connection, provide the name of your virtual machine in the Computer dialog
box using this format:
vm20532a[Your Name Here].cloudapp.net:[Your VM RDP Port]
Note: The name and port for your VM may already be saved in the drop-down list when
selecting a Computer. If this is the case, use this value instead of typing it in manually. If you are
unsure about your VM’s RDP port, use either of the Azure portal to look up your VM’s endpoints.
The endpoint with the name Remote Desktop is the correct port for RDP. This port is
randomized to protect your VM from unauthorized access.
3. In Remote Desktop Connection, click Connect. Wait until the RDP client accesses the virtual machine.
Note: For this lab, we will use the Management Portal since the functionality to create new
Azure Active Directory domains is not available in the Preview Portal.
o Name: 20532
Note: Make sure you record the temporary password generated when you create the new
user. In case you forget, you can always reset the user’s password using the Reset Password
button next to the Add User button in the Management Portal.
MCT USE ONLY. STUDENT USE PROHIBITED
11-10 Implementing Security in Web Applications using Azure
o Role: User
Note: Make sure you record the temporary password generated when you create the new
user. In case you forget, you can always reset the user’s password using the Reset Password
button next to the Add User button in the Management Portal.
Results: After completing this exercise, you will be able to create an Azure AD Directory and populate
that directory with users.
2. Stop Debugging
Results: After completing this exercise, you will be able to use MVC to require a user to be logged in
before accessing a controller or action.
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 11-11
• Create a new ASP.NET MVC application using ASP.NET Identity for authentication and authorization.
2. Create a New Management Web Application using Azure AD as the Identity Provider
3. Verify that the Management Web Application Requies Login using a Organizational Account
Note: The original IIS 8.0 Express installation with Visual Studio 2013 Update 3 can be
corrupted when you image your machine and recreate the machine with a new user. IIS Express
depends on configuration files that are located in your user’s Documents folder. When the
machine is imaged, the old user account is lost and a new user account is created when you
create a new VM from the image. Repairing the installation will create the configuration files for
your new user.
Task 2: Create a New Management Web Application using Azure AD as the Identity
Provider
1. Create a new Contoso.Events.Management ASP.NET Web Application in the Administration
solution folder with the following details:
o Project Name: Contoso.Events.Management
o Template: MVC
o Authentication: Organizational Accounts
Note: When associating your new ASP.NET Web Application with an Azure Active Directory
domain, you must login using an account that is a Global Administrator.
Note: Ensure that you copy the folders and not any individual files. Ignore the following
files:
• favicon.ico
• Global.asax
• packages.config
• Web.config
Task 3: Verify that the Management Web Application Requies Login using a
Organizational Account
1. Debug the solution.
2. Verify that you are required to login before accessing the Contoso.Events.Managent web
application.
Results: After completing this exercise, you will be able to use an Azure AD domain with the ASP.NET
Identity framework.
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 11-13
Note: The ASP.NET Identity framework is a newer way of securing web applications and has
certain advantages over Membership and Forms Authentication.
Review Question(s)
Question: When using Azure Active Directory Access Control Service, why would you want
to remap the claims from each identity provider?
MCT USE ONLY. STUDENT USE PROHIBITED
11-14 Implementing Security in Web Applications using Azure
MCT USE ONLY. STUDENT USE PROHIBITED
12-1
Module 12
Deploying Web Applications to Azure
Contents:
Module Overview 12-1
Module Overview
Moving applications from a development environment to either a staging or production environment can
be an arduous task. Technologies have been around such as FPSE, FTP and WebDeploy to help make this
easier. We can take advantage of either existing technologies or new deployment methods to publish our
cloud web applications to Azure. Lesson 1, “Deployment Strategies for Azure Web Applications”, lists
some of the methods that can be used to deploy applications in general. Lesson 2, “Deploying Web
Applications using Cloud Service Packages”, describes the publish process for Azure Cloud Services.
Lesson 3, “Deploying Web Applications using WebDeploy”, describes the publish process for Azure Web
Sites. Lesson 4, “Monitoring Cloud Applications”, details the various tools available to perform forensic
analysis of a web application.
Objectives
After completing this module, you will be able to:
• List the deployment strategies for web applications.
Lesson 1
Deployment Strategies for Web Applications
There are many existing methods for deploying web applications that can even be used with applications
in Azure. It is important to understand the differences between each method so that the best one can be
selected for each rollout.
This lesson will list and describe the different methods for deploying web applications.
Lesson Objectives
After completing this lesson, you will be able to:
Deployment Methods
MCT USE ONLY. STUDENT USE PROHIBITED
12-4 Deploying Web Applications to Azure
Lesson 2
Deploying Azure Web Sites
ASP.NET Web Applications that are deployed to Azure Web Sites simply use the WebDeploy protocol and
packages. The publish wizard for this method even allows you to customize the behavior of a Database
context that uses Entity Framework Code First Migrations.
This lesson describes the publish process for ASP.NET Web Applications that are being deployed to a
Windows Azure Web Site instance.
Lesson Objectives
After completing this lesson, you will be able to:
• Describe how Entity Framework Code First can be manipulated in the Publish Wizard.
Lesson 3
Deploying Azure Cloud Services
Azure Cloud Service projects use a special type of package during the publish process. This package
contains the configuration settings for each role along with instance counts, VM sizes and other Cloud
Service settings.
This lesson describes the publish process for a Cloud Service project.
Lesson Objectives
After completing this lesson, you will be able to:
• Use different configuration settings for the cloud environment and the local environment.
Lesson 4
Continuous Integration
Source Control providers can be used in an integrated manner with Azure Web Sites or Cloud Services.
Using Visual Studio Online, you can gain insights into your application’s behavior and status using
feature-rich dashboards and reports. Visual Studio Online and other source control providers can also be
used to continuously deploy your web applications to Azure Web Site instances.
This lesson introduces the Visual Studio Online service and how it (along with other source control
providers) can be used to continuously deploy the latest build of your web application to an Azure Web
Site.
Lesson Objectives
After completing this lesson, you will be able to:
Lesson 5
Monitoring Cloud Applications
Once web applications are deployed to the cloud, there are many options available for debugging the
applications and even monitoring the applications’ logs. Even Intellitrace logs can be captured from
errant cloud services.
This lesson describes the different options available for monitoring web applications hosted in Azure.
Lesson Objectives
After completing this lesson, you will be able to:
Service Logs
Objectives
After you complete this lab, you will be able to:
For this lab, you will use the available host machine. Before you begin this lab, you must complete the
following steps:
• Prior to starting this lab, you must have completed the labs in Modules 2 and 3.
1. On the host computer, click Start, type Remote, and then click Remote Desktop Connection.
2. In Remote Desktop Connection, provide the name of your virtual machine in the Computer dialog
box using this format:
vm20532a[Your Name Here].cloudapp.net:[Your VM RDP Port]
Note: The name and port for your VM may already be saved in the drop-down list when
selecting a Computer. If this is the case, use this value instead of typing it in manually. If you are
unsure about your VM’s RDP port, use either of the Azure portal to look up your VM’s endpoints.
The endpoint with the name Remote Desktop is the correct port for RDP. This port is
randomized to protect your VM from unauthorized access.
3. In Remote Desktop Connection, click Connect. Wait until the RDP client accesses the virtual machine.
4. Record the Name and Primary Access Key for the Storage Account instance.
2. Create a Service Bus namespace in your subscription with the following details:
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 12-13
3. Record the ACS connection string for the Service Bus namespace.
Results: After completing this exercise, you will be able to create services that will be used for your
deployed web application.
4. Find the Service Bus connection string setting with the name
Microsoft.ServiceBus.ConnectionString and update it for all configurations with the following
values:
o Type: String
5. For the Cloud service configuration, locate the two settings with the names
Microsoft.WindowsAzure.Storage.ConnectionString &
Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString and set the connection string
using the Storage Account Name and Primary key recorded from the previous task.
7. View the Local service configuration settings and ensure that the storage connection strings are using
development storage.
8. Open the Contoso.Events.Web role’s property page.
9. Go to the Settings section of the property page.
MCT USE ONLY. STUDENT USE PROHIBITED
12-14 Deploying Web Applications to Azure
10. For the Cloud service configuration, locate the two settings with the names
Microsoft.WindowsAzure.Storage.ConnectionString &
Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString and set the connection string
using the Storage Account Name and Primary key recorded from the previous task.
11. View the Local service configuration settings and ensure that the storage connection strings are using
development storage.
Task 2: Modify the Web.config Transformation File for the Administration Project
1. Open the Web.Debug.config file in the Contoso.Events.Web project.
Task 3: Modify the app.config File for the Worker Role Project
1. Open the app.config file in the Contoso.Events.Worker project.
Task 4: Modify the Web.config Transformation File for the Web Role Project
1. Open the Web.Release.config file in the Contoso.Events.Web project.
Results: After completing this exercise, you will be able to make changes to your web applications so that
they will use different settings and connection strings after they are deployed to the cloud.
Task 1: Deploy the Cloud Service Project to a Cloud Service Production Environment
1. Begin the Publish Windows Azure Application wizard for the Contoso.Events.Cloud project.
2. Create a new Cloud Service instance using the Wizard with the following details:
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 12-15
o Region or Affinity Group: Select the region that is closest to your location
o Environment: Production
o Build configuration: Release
Task 2: Deploy the ASP.NET Web Application Project to a Web Site Instance
1. Using the Server Explorer, create a new WebSite with the following details:
3. Publish the web application to the newly created Website instance with the following details:
Results: After completing this exercise, you will be able to deploy projects to both Azure Web Sites and
Cloud Services.
2. On the Website settings page, change the Application Logging (File System) setting to Verbose
and save the changes.
4. Open the website in Internet Explorer and verify that the log information is shown when navigating to
a page.
MCT USE ONLY. STUDENT USE PROHIBITED
12-16 Deploying Web Applications to Azure
Results: After completing this exercise, you will be able to view a live stream of the Trace logs for an
Azure Web Site.
MCT USE ONLY. STUDENT USE PROHIBITED
Developing Microsoft Azure™ Solutions 12-17
Best Practice: WebDeploy is a very flexible and modern method of deploying packages to
and from IIS. Even for on premise applications, WebDeploy typically is one of the best choices
for deploying your web applications and configuring IIS.
Review Question(s)
Question: When deploying a web application to the cloud, what are some examples of
settings that should be different locally then in the cloud?
MCT USE ONLY. STUDENT USE PROHIBITED
12-18 Deploying Web Applications to Azure
Course Evaluation
Your evaluation of this course will help Microsoft understand the quality of your learning experience.
Please work with your training provider to access the course evaluation form.
Microsoft will keep your answers to this survey private and confidential and will use your responses to
improve your future learning experience. Your open and honest feedback is valuable and appreciated.
MCT USE ONLY. STUDENT USE PROHIBITED
L2-1
2. Browse to https://portal.azure.com
3. Enter your Microsoft Account e-mail
3. In the Virtual networks blade that appears, view your list of Virtual Network instances.
6. In the Gallery blade that appears, click the Virtual machines link.
7. In the Virtual machines blade that appears, scroll down and select Virtual Network.
8. In the Virtual Network blade that appears, click the full Azure portal hyperlink at the bottom.
Note: Creating Virtual Networks is not available in the Preview Portal yet. This hyperlink
will take you to the Management Portal.
Note: If this is your first time accessing the Management Portal, you may see a
Management Portal Tour dialog appear. You can either review the information provided in this
tour or dismiss it by using the x button in the top right corner of the dialog.
10. In the navigation pane on the left side, scroll down and click Networks.
11. At the bottom left corner of the screen, click New.
12. If it is not automatically selected, select Network Services => Virtual Network => Quick Create.
o In the Location list, select the region that is closest to your current location.
Results: After completing this exercise, you will have a new Virtual Network in Azure.
MCT USE ONLY. STUDENT USE PROHIBITED
L2-3
5. In the New blade that appears, click the Storage link near the bottom.
6. In the Storage account blade that appears, do the following:
7. In the Storage dialog box, provide the value stor20532[Your Name Here].
11. In the Recommended Pricing Tiers blade, select the L1 LRS option for local redundancy.
12. Click the Select button.
3. In the Virtual machines blade that appears, view your list of Virtual Machine instances.
4. At the bottom left corner of the screen, click New.
5. In the New blade that appears, click the Windows Server 2012 R2 Datacenter link near the top.
14. In the Recommended Pricing Tiers blade, click the Select button.
18. In the Virtual Network blade, select your previously created network Net20532A.
19. In the Network blade, click the OK button.
MCT USE ONLY. STUDENT USE PROHIBITED
L2-4 Developing Microsoft Azure™ Solutions
20. In the Optional Config blade, click the Storage Account link.
21. In the Storage account blade, select your previously created Storage account stor20532[Your
Name Here].
23. Click the Create button to create the Virtual Machine using your specified configuration.
Note: The creation of a new Virtual Machine can take anywhere from 5-10 minutes. The
Startboard (home screen) will notify you when your VM is created and running.
24. Select the newly created Virtual Machine from your Startboard.
25. In the vm20532a[Your Name Here] blade, scroll down to the Disks tile.
31. In the Storage account blade, select your previously created Storage account stor20532[Your
Name Here]
32. In the Choose a container blade, click the Choose Container link.
Note: Wait about 5 minutes for the empty disk to be attached to the virtual machine.
41. In the Remote Desktop Connection – Unknown Publisher dialog, do the following:
42. Click Don’t ask me again for connections to this computer to prevent this dialog from showing up
again.
45. For the User name dialog box, provide the value testuser.
46. For the Password dialog box, provide the value TestPa$$w0rd.
47. Click OK.
MCT USE ONLY. STUDENT USE PROHIBITED
L2-5
48. In the Remote Desktop Connection – Untrusted Certificate dialog, do the following:
49. Verify the Remote certificate name matches the name of your Virtual Machine.
50. Click Don’t ask me again for connections to this computer to prevent this dialog from showing up
again.
52. When you are prompted to allow your network connection to discover external devices, click No.
Results: After completing this exercise, you will have a new Virtual Machine stored in a new Storage
account.
MCT USE ONLY. STUDENT USE PROHIBITED
L2-6 Developing Microsoft Azure™ Solutions
4. In the Internet Explorer Enhanced Security Configuration dialog box, do the following:
7. Click OK.
8. Use the Windows Key + W shortcut key combination to open Universal Search – Settings.
9. In the Search dialog box, provide the value disk.
10. Click the Create and format hard disk partitions option.
13. Verify that MBR (Master Boot Record) is the selected partition style.
14. Click OK.
15. In the bottom half of the Disk Management window, do the following:
16. Scroll down and find Disk 2 that was previously initialized.
17. Right-click the Unallocated partition and select New Simple Volume….
18. In the New Simple Volume Wizard, do the following:
22. In the Assign the following drive letter list, select the value F.
23. Click Next.
24. Verify that the File System setting is set to NTFS.
25. In the Volume Label dialog box, provide the value AllFiles.
Note: If a dialog box shows up stating that “You need to format the disk in drive F: before you can
use it.”, you can safely close this dialog since you already formatted the disk.
28. On the Windows Start screen, click the Internet Explorer tile.
30. Select the Use recommended security and compatibility settings option.
31. Click OK.
MCT USE ONLY. STUDENT USE PROHIBITED
L2-7
36. “The download of the AllFiles executable typically takes around 5 minutes.”
37. On the Official Microsoft Learning Product License Terms dialog box, click Accept.
38. On the WinRAR self-extracting archive dialog box, do the following:
o http://go.microsoft.com/fwlink/?LinkID=510170
6. Click Next.
Note: You will notice that Internet Explorer blocks the download popup. You will need to
view the yellow warning message at the bottom of the Internet Explorer window, click Options for
this Site and then click Always Allow. This will allow you to view popups and downloads without
any restriction.
7. At the bottom of the Internet Explorer window, click the Run button in the download dialog.
8. In the initial Visual Studio dialog, click the I agree to the License Terms and Privacy Policy
checkbox.
9. Click Next.
10. In the Optional features to install list, click the Windows Phone 8.0 SDK checkbox.
11. Click Install.
Note: The download of required assets for Visual Studio 2013 typically takes around 10-15
minutes. The installation of said assets will take another 10 minutes.
12. Click Restart Now.
Note: The Remote Desktop connection will now close and the Virtual Machine will restart. Give
the Virtual Machine about 5 minutes before trying to connect to it again using Remote Desktop.
14. Switch to the Microsoft Azure – Virtual Machines tab in Internet Explorer.
Note: You may need to log into the portal again if the browser has timed out and logged off
your portal user.
MCT USE ONLY. STUDENT USE PROHIBITED
L2-8 Developing Microsoft Azure™ Solutions
18. For the User name dialog box, provide the value testuser.
19. For the Password dialog box, provide the value TestPa$$w0rd.
22. In the Visual Studio Ultimate 2013 dialog box, click Launch.
23. In the Visual Studio Sign In dialog box, click Not now, maybe later.
24. In the Visual Studio Settings dialog box, do the following:
28. Close the Visual Studio 2013 Ultimate window by clicking the x button in the top right-hand corner
of the window.
a. http://go.microsoft.com/fwlink/?LinkID=510171
3. Press Enter.
4. Expand the Details section by clicking the plus button immediately to the left of the Details header.
Note: You may have to wait a minute or two while the Web Platform Installer 5.0
software is installed that will retrieve the Azure SDK for .NET 2.4.
7. Verify that the package is named Windows Azure SDK for .NET (VS 2013) – 2.4.
8. Click Install.
9. Click I Accept.
10. “The download and installation of the SDK takes about 5 minutes.”
11. Wait for the Web Platform Installer process to complete.
16. On the Start screen, click the down arrow to see all applications and then right-click the Visual
Studio 2013 tile.
17. Click the Pin to Start button at the bottom of the screen.
18. Click the Visual Studio 2013 tile.
20. Locate the Azure node and click the arrow immediately to the left.
21. Right-click the Azure node and click “Connect to Microsoft Azure”.
22. If necessary, login to your Azure subscription using your Microsoft account credentials.
Results: After completing this exercise, your development Virtual Machine will have Visual Studio and the
Azure SDK installed.
MCT USE ONLY. STUDENT USE PROHIBITED
L2-10 Developing Microsoft Azure™ Solutions
cd %windir%\system32\sysprep
sysprep.exe
Note: You will be disconnected from the Virtual Machine once SysPrep is completed. The VM
will shutdown and this will close your RDP connection.
2. Browse to https://manage.windowsazure.com
3. Enter your Microsoft Account e-mail
7. In the navigation pane on the left side, scroll down and click Virtual Machines.
8. Click the Virtual Machine Instances tab at the top of the screen.
9. Select the newly created Virtual Machine in the list of Virtual Machine Instances.
11. In the Capture the virtual machine dialog box, do the following:
12. In the Image Name dialog, provide the value vm20532Template.
13. In the Image Description dialog, provide the value Template for 20532 VM.
14. Select the I have run Sysprep on the virtual machine checkbox.
Results: After completing this exercise, you will have a custom image in Azure that can be used to create
new Virtual Machines.
MCT USE ONLY. STUDENT USE PROHIBITED
L2-12 Developing Microsoft Azure™ Solutions
MCT USE ONLY. STUDENT USE PROHIBITED
L3-1
2. Browse to https://portal.azure.com.
2. In the New blade that appears, click the SQL Server 2014 Standard link near the top.
3. In the Create VM blade that appears, do the following:
4. In the Host Name dialog, provide a value with the prefix db20532a and ending with your name.
8. In the Recommend Pricing Tiers blade, click the Browse All Pricing Tiers link.
9. Select the A2 Standard option.
11. In the Recommended Pricing Tiers blade, click the Select button.
12. Click the Optional Configuration link.
15. In the Virtual Network blade, select your previously created network Net20532A.
16. In the Network blade, click the OK button.
17. In the Optional Config blade, click the Storage Account link.
18. In the Storage account blade, select your previously created Storage account stor20532[Your
Name Here].
20. Click the Create button to create the Virtual Machine using your specified configuration.
MCT USE ONLY. STUDENT USE PROHIBITED
L3-2 Developing Microsoft Azure™ Solutions
21. Select the newly created Virtual Machine from your Startboard.
23. Click Connect at the top of the db20532[Your Name Here] blade.
26. Click Don’t ask me again for connections to this computer to prevent this dialog from showing up
again.
27. Click Connect.
30. For the Password dialog box, provide the value TestPa$$w0rd.
33. Verify the Remote certificate name matches the name of your Virtual Machine.
34. Click Don’t ask me again for connections to this computer to prevent this dialog from showing up
again.
36. When you are prompted to allow your network connection to discover external devices, click No.
12. In the Specific local ports: dialog, provide the value 1433.
13. Click the Next button.
2. Find and click the SQL Server 2014 Management Studio application.
6. Right-click the SQL Server node at the top of the Object Explorer pane and click Properties.
9. In the Server authentication section, select the SQL Server and Windows Authentication mode.
11. In the Microsoft SQL Server Management Studio dialog, click OK.
12. Right-click the SQL Server node at the top of the Object Explorer pane and click Restart.
13. In the Microsoft SQL Server Management Studio dialog, click Yes.
14. Right-click the Security node in the Object Explorer pane, hover over New, and then click Login….
22. Ensure the User must change password at next login checkbox is unselected.
23. Click the Server Roles page.
27. Right-click the Databases node in the Object Explorer pane and click New Database….
28. In the New Database dialog box, do the following:
Results: After completing this exercise, your will have a new Virtual Machine with SQL installed that can
use Mixed Mode authentication when accessed by an external Virtual Machine.
MCT USE ONLY. STUDENT USE PROHIBITED
L3-5
2. If it is not automatically selected, select Compute => Virtual Machine => From Gallery.
4. In the Virtual Machine Name dialog box, provide a value with the prefix vm20532a and ending
with your name.
7. In the New User Name dialog box, provide the value testuser.
11. In the Region/Affinity Group/Virtual Network list, select your previously created virtual network
Net20532A.
13. Click the checkmark button to create the Virtual Machine using your specified configuration.
Results: After completing this exercise, you will have a new Virtual Machine created from your
development image.
MCT USE ONLY. STUDENT USE PROHIBITED
L3-6 Developing Microsoft Azure™ Solutions
Exercise 3: Connect the Test Application to the SQL Server Virtual Machine
Task 1: Login to the Azure Preview Portal
1. On your host machine, switch to the Internet Explorer application.
4. In the db20532a[Your Name Here] blade that appears, click the Properties tile.
5. In the Properties blade that appears, record the value of the Internal IP Address field.
6. Close the Properties blade by click the X button at the top right corner of the blade.
3. In the Virtual machines blade that appears, select the row for your virtual machine named
vm20532a[Your Name Here].
4. In the vm20532a[Your Name Here] blade that appears, click the Connect button at the top.
8. Click Don’t ask me again for connections to this computer to prevent this dialog from showing up
again.
9. Click Connect.
11. For the User name dialog box, provide the value testuser.
12. For the Password dialog box, provide the value TestPa$$w0rd.
14. In the Remote Desktop Connection – Untrusted Certificate dialog, do the following:
15. Verify the Remote certificate name matches the name of your Virtual Machine.
16. Click Don’t ask me again for connections to this computer to prevent this dialog from showing up
again.
17. Click Yes.
18. When you are prompted to allow your network connection to discover external devices, click No.
MCT USE ONLY. STUDENT USE PROHIBITED
L3-7
Task 4: Repair the Azure SDK for .NET Storage Emulator Installation
Note: When using SysPrep with your original application VM, the user that installed the
Storage Emulator is removed. When you create a new VM from the template, you create a new
user and this user does not have access to some of the files and applications that the old user
could access. Because of this, you must repair the Storage Emulator Installation.
o http://www.microsoft.com/en-us/download/details.aspx?id=43709
3. Press Enter.
6. Click Next.
Note: You will notice that Internet Explorer blocks the download popup. You will need to
view the yellow warning message at the bottom of the Internet Explorer window, click Options for
this Site and then click Always Allow. This will allow you to view popups and downloads without
any restriction.
7. At the bottom of the Internet Explorer window, click the Run button in the download dialog.
8. In the Windows Azure Storage Emulator – v3.3 Setup installation wizard, do the following:
o Click Next.
Note: Since this is your first time starting Visual Studio with this sysprep image, you will have to
walk through the setup steps (from Module 2) for Visual Studio again. Visual Studio detects that you are a
“new user” using the product for the first time.
4. In the Visual Studio Sign In dialog box, click Not now, maybe later.
9. In the Solution Explorer pane, right-click the Contoso.Events.Web project and then click Set as Startup
Project.
Note: This web application references multiple NuGet packages. When you debug the
solution, Visual Studio will start by building the solution. The act of building the solution triggers
the NuGet automatic package restore capability.
http://go.microsoft.com/fwlink/?LinkID=510175
11. On the home page of the web application, enter the previously recorded Internal IP Address for the
SQL Server VM in the IP Address dialog.
12. Click the Verify button.
Results: After completing this exercise, you will have used the Internal IP address of the Database Virtual
Machine in your Virtual Network to connect to SQL Server 2014.
MCT USE ONLY. STUDENT USE PROHIBITED
L3-9
2. At the top of the Server Manager window, click the Manage link.
3. Click the Add Roles and Features menu item.
8. Your vm20532a[Your Name Here] server is already selected, leave all options to their default values.
9. Click the Next button to move to the Server Roles page.
10. In the Roles list, click the Web Server (IIS) checkbox to select the Role.
11. Click the Add Features button in the Add Roles and Features Wizard dialog that appears.
12. Click the Next button to move to the Features page.
13. Click the Next button to move to the Web Server Role (IIS) page.
14. Click the Next button to move to the Role Services page.
15. In the Role services list, expand the Application Development option by clicking the arrow on the
left.
16. Click the ASP.NET 4.5 checkbox to select the Role Service.
17. Click the Add Features button in the Add Roles and Features Wizard dialog that appears.
21. When the installation is complete, close the Add Roles and Features Wizard dialog.
22. Close the Server Manager application.
2. In the Solution Explorer pane, right-click the Contoso.Events.Web project and then click Publish….
8. In the Site name dialog box, provide the value Default Web Site
11. On the home page of the web application, enter the previously recorded Internal IP Address for the
SQL Server VM in the IP Address dialog.
5. In the Virtual machines blade that appears, select the row for your virtual machine named
vm20532a[Your Name Here].
6. In the vm20532a[Your Name Here] blade that appears, scroll down and click the Endpoints tile.
11. In the Public Port dialog box, provide the value 80.
12. In the Private Port dialog box, provide the value 80.
4. Copy the Domain Name value for your Virtual Machine instance.
7. On the home page of the web application, enter the previously recorded Internal IP Address for the
SQL Server VM in the IP Address dialog.
8. Click the Verify button.
Results: After completing this exercise, you will have enabled IIS and the ASP.NET features on your
Windows Server 2012 R2 Virtual Machine and created a custom HTTP Endpoint for port 80 to view your
web server from any public browser.
MCT USE ONLY. STUDENT USE PROHIBITED
L3-12 Developing Microsoft Azure™ Solutions
MCT USE ONLY. STUDENT USE PROHIBITED
L4-1
2. Browse to https://manage.windowsazure.com.
3. Enter your Microsoft Account e-mail and password and then click Sign In.
Note: You can also click the + New button at the bottom of the screen in the left corner.
9. In the Region list, select the region that is closest to your location.
10. In the Url dialog box, create a unique name for your website.
11. In the Database list, select Create a free 20 MB SQL database.
12. In the DB Connection String Name dialog box, provide the connection string:
EventsContextConnectionString.
14. In the Name dialog box, provide the database name: EventsContextDB.
15. In the Server dialog box, select New SQL database server.
16. In the Server Login Name dialog box, create a username for your administrative SQL user.
17. In the Server Login Password dialog boxes, create a password for your administrative SQL user.
18. Click the checkmark button to create your Web Site and SQL database.
Note: While creating an Azure Website is typically very fast, you have to wait for the Web
Site to be created and running before browsing to the site. This is indicated by the WebSite
having a status of “Running” when viewing it in the Web Sites list.
2. In the Web Sites list, click the web site that you just created.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-2 Developing Microsoft Azure™ Solutions
4. Locate the Quick Glance section on the right side of the dashboard
5. Under the Site Url header, click the hyperlink to the website.
Results: After completing this exercise, you will be able to use the Management Portal to create Azure
Web Site instances and browse to the instance.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-3
4. In the Solution Explorer pane, right-click the Contoso.Events.Management project and then click
Set as Startup Project.
Note: If this is the first time Building this solution, NuGet will implicitly restore any missing
packages. This does not require any interaction on your part.
6. On the home page of the web application, verify that it shows a list of three events under the Latest
3 Events header.
7. Click the Events link in the navigation bar at the top of the web page.
Task 2: Download the Publish Profile for the Azure Web Site
1. On the Start screen, click the Internet Explorer tile.
2. Browse to https://manage.windowsazure.com.
3. Enter your Microsoft Account e-mail and password and then click Sign In.
4. In the Web Sites list, click the website that you just created.
8. In the download dialog, click the arrow immediately to the right of the Save button and click Save
As.
9. In the Save As window, navigate to Allfiles (E):\Mod04\Labfiles, and then click Save.
Task 3: Publish the ASP.NET Web Application to the Azure Web Site
1. In the Solution Explorer pane of the Contoso.Events - Microsoft Visual Studio window, right-click
Contoso.Events.Management and then click Publish….
4. Click Browse….
5. In the Libraries window, navigate to Allfiles (E):\Mod04\Labfiles, and then double-click your
previously saved publish profile.
6. Click OK.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-4 Developing Microsoft Azure™ Solutions
7. Verify that the Site Name dialog box matches your Azure Web Site’s name.
8. Click Publish.
Note: If you see the placeholder page that was shown in Exercise 1 - Task 2, make sure to
refresh your browser as there may be client side caching occurring. You can always force refresh
your browser and cache by using the Ctrl+F5 key combination.
1. On the home page of the web application, verify that it shows a list of three events under the Latest
3 Events header.
2. Click the Events link in the navigation bar at the top of the web page.
Results: After completing this exercise, you will be able to use a publish profile to publish web
applications directly an Azure Web Site.
MCT USE ONLY. STUDENT USE PROHIBITED
L4-5
this.EventCount = 3;
this.EventCount =
Int32.Parse(ConfigurationManager.AppSettings["EventsListViewModel.EventCount"]);
5. In the Solution Explorer pane of the Contoso.Events - Microsoft Visual Studio window, expand the
Contoso.Events.Management project.
6. In the Solution Explorer pane, double-click Web.config.
2. Browse to https://manage.windowsazure.com.
3. Enter your Microsoft Account e-mail and password and then click Sign In.
4. In the Web Sites list, click the website that you just created.
Note: Typically there is a very short wait after updating configuration settings before you
are able to view the web site and see the configuration changes. You will know that the
configuration changes are applied when the Configure tab is editable again.
2. Locate the Quick Glance section on the right side of the dashboard
3. Under the Site Url header, click the hyperlink to the website.
4. On the home page of the web application, verify that it shows a list of two events under the Latest 2
Events header.
Results: After completing this exercise, you will be able to leverage custom appSettings using a
web.config or the Azure Management Portal.
MCT USE ONLY. STUDENT USE PROHIBITED
L6-1
Note: If the UAC prompt appears, you can elevate permissions so that you can run Visual
Studio 2013 as an Administrator.
6. Expand the Solution Explorer pane to view the projects in the solution.
Task 2: Add a Reference to the Azure SDK Libraries and Solution Projects
1. Right-click the Contoso.Events.Worker project.
2. Hover over the Add menu item.
3. Click Reference….
7. Click OK.
8. Right-click the Contoso.Events.Worker project.
16. Click OK
17. On the VIEW menu, hover over the Other Windows menu item and then click Package Manager
Console.
18. In the Package Manager Console pane, locate the Default Project list box and then select
Contoso.Events.Worker.
19. In the Package Manager Console text area, immediately to the right of:
PM>
4. Click Add.
5. In the Solution Explorer pane, expand the Contoso.Events.Worker project.
class WorkerRole
using Microsoft.WindowsAzure.ServiceRuntime;
11. Replace that single line of code with the following code:
12. Click anywhere between the opening and closing curly brackets of the WorkerRole class.
13. Use the return key to add vertical space for your method[s].
14. Add the following block of code to your class:
15. Add the following using block to the top of the class:
using System.Net;
16. Click anywhere between the opening and closing curly brackets of the WorkerRole class.
17. Use the return key to add vertical space for your method[s].
19. Add the following using blocks to the top of the class:
using System.Diagnostics;
using System.Threading;
Task 4: Implement the Run Logic to Get Requests from the SQL Database
1. Right-click the Contoso.Events.Worker project.
7. Click Add.
8. In the Destination File Exists dialog, click the Yes button to replace the existing file.
9. In the Microsoft Visual Studio dialog, click the Yes button to refresh the source editor.
MCT USE ONLY. STUDENT USE PROHIBITED
L6-4 Developing Microsoft Azure™ Solutions
Results: After completing this exercise, you will be able to create a Worker Role class library and
implement the appropriate pattern for a background worker.
MCT USE ONLY. STUDENT USE PROHIBITED
L6-5
2. If you have not saved the project yet, you will be prompted to save the project. Click Yes.
3. In the Solution Explorer pane, right-click the Contoso.Events.Worker project and then click Edit
Contoso.Events.Worker.csproj.
5. Immediately after the <PropertyGroup> XML element and before the <Configuration> XML
element, add the following XML element:
<RoleType>Worker</RoleType>
6. In the Solution Explorer pane, right-click the Contoso.Events.Worker project and then click Reload
Project.
7. You will be prompted to close the .csproj file since it is already open. Click Yes.
8. If you have not saved the file, you will be prompted to save the .csproj file. Click Yes.
9. In the Solution Explorer pane, expand the Contoso.Events.Cloud project, then the Roles folder.
10. Right-click the Roles folder.
Note: If the Worker Role Project in Solution… option is disabled, you can enable it by
reloading the Contoso.Events.Worker project using the following steps:
13. In the Solution Explorer pane, right-click the Contoso.Events.Worker project and then click
Unload Project
14. In the Solution Explorer pane, right-click the Contoso.Events.Worker project and then click Reload
Project
Results: After completing this exercise, you will be able to take an existing Class Library project and turn it
into a Worker Role in an existing Cloud Service project.
MCT USE ONLY. STUDENT USE PROHIBITED
L6-6 Developing Microsoft Azure™ Solutions
3. On the homepage of the Contoso Events web site, click the name of any event.
5. Refresh the page once every 30 seconds until the sign-in sheet is generated.
Note: You will know that the sign-in sheet generation is done when the text of the button
changes from “Generate Sign-In Sheet” to “Download Sign-In Sheet”.
6. Click the Download Sign-In Sheet button to download the Word document.
7. At the bottom of the Internet Explorer window, click the Run button in the download dialog.
8. Observe the content of the .docx file that opened in WordPad.
Results: After completing this exercise, you will be able to debug a Worker Role.
MCT USE ONLY. STUDENT USE PROHIBITED
L7-1
2. Browse to https://portal.azure.com.
3. In the bottom left corner of the portal, click the New button.
4. In the New blade that appears, click the SQL Database link.
5. In the SQL database blade that appears, do the following:
6. In the Name dialog box, provide the value db20532a[Your Name Here].
7. Click the Pricing Tier link.
8. In the Recommended pricing tier blade that appears, select the Web option.
12. In the New Server blade that appears, locate the Server Name dialog box.
13. In the Server Name dialog box, provide the value sv20532a[Your Name Here].
14. In the Server Admin Login dialog box, provide the value testuser.
18. In the Location blade that appears, select the region that is closes to your location.
19. In the New server blade, click the OK button.
20. In the SQL database blade, click the Create button to create the SQL Database and Server.
Results: After completing this exercise, you will be able to create both servers and databases in the Azure
SQL Databases service.
MCT USE ONLY. STUDENT USE PROHIBITED
L7-3
4. In the Solution Explorer pane, right-click the Contoso.Events.DataGeneration project, highlight Debug
and then click Start New Instance.
Note: The Data Generation script takes between 1-2 minutes to run.
5. In the Solution Explorer pane, right-click the Contoso.Events.Cloud project and then click Set as
Startup Project.
7. On the home page of the web application, verify that it shows a list of multiple events.
8. Close the tab displaying the website.
6. Click Add.
7. In the EventsContextInitializer class, add the accessor public to the left of the class definition:
class EventsContextInitializer
11. Add this using statement to the top of the code file:
using System.Data.Entity;
14. Within the static constructor static EventsContext(), add the following line of code:
Database.SetInitializer<EventsContext>(new EventsContextInitializer());
using Contoso.Events.Models;
5. Place your typing cursor immediately before the closing bracket of the Seed(EventsContext
context) method.
7. Place your typing cursor immediately before the closing bracket of the Seed(EventsContext
context) method.
context.Events.Add(eventItem);
9. Place your typing cursor immediately before the closing bracket of the Seed(EventsContext
context) method.
11. Place your typing cursor immediately before the closing bracket of the Seed(EventsContext
context) method.
context.Registrations.Add(registrationItem);
MCT USE ONLY. STUDENT USE PROHIBITED
L7-5
13. Place your typing cursor immediately before the closing bracket of the Seed(EventsContext
context) method.
context.SaveChanges();
16. In the Solution Explorer pane, right-click the Contoso.Events.Data project and then click Build.
Task 4: Publish the Cloud Application with the Updated DbContext to Azure
1. In the Solution Explorer pane, expand the Contoso.Events.Web project.
2. In the Solution Explorer pane, expand the Web.config file in the Contoso.Events.Web project.
3. Double-click the Web.Release.config file.
4. In the Web.Release.config file update the EventsContextConnectionString and provide these values:
o [database]: db20532a[Your Name Here]
o [login]: testuser
6. In the Solution Explorer pane, right-click the Contoso.Events.Cloud project and then click Publish.
2. Otherwise, you will be immediately directed to the Windows Azure Publish Settings step.
5. Otherwise, locate the Cloud Service list and select the Create New value to open the dialog.
6. In the Create Cloud Service dialog, do the following:
9. Click Create.
Note: It typically takes between 5-10 minutes for the publish operation to complete. You can
track the progress of your publish in the Windows Azure Activity Log pane that is opened when you
being publishing your Cloud Service project.
Task 5: Verify that the Azure Cloud Service Website is using the New Data
1. Wait until the publish process is complete and the console window shows a line with the message
“Complete”.
Note: The publish process is complete when the message Complete is shown in the
Windows Azure Activity Log’s history console. The green circular indicator in the Activity Log
does not necessarily indicate that the publish process is complete, just that the package has been
uploaded successfully.
2. In the Windows Azure Activity Log, click the hyperlink to the published web application.
3. Verify that the website shows the single event you created in your Entity Framework context
initializer.
3. Enter your Microsoft Account e-mail and password and then click Sign In.
Task 7: View the Migrated Data in the Azure SQL Management Portal
1. In the navigation pane on the left side, scroll down and click SQL Databases.
2. Click the Databases tab at the top of the screen.
3. In the list of SQL Databases, click the Name of your SQL Database with the prefix db20532a.
6. You will be prompted to add your IP address to those included in the firewall rules to manage your
database. Click Yes.
Note: If you have not visited the Management Portal before, you will notice that Internet
Explorer blocks the popup. You will need to view the yellow warning message at the bottom of
the Internet Explorer window, click Options for this Site and then click Always Allow. This will
allow you to view popups without any restriction. Once these steps are complete, you will see
the Azure Management Portal refresh. You can then click the Manage button again to resume
the lab.
7. Once your IP address is added, you will be prompted again to ask if you would like to manage your
database. Click Yes.
12. In the bottom left corner of the Management Portal – SQL Database window, click the Design
button.
14. Click the Edit button immediately to the right of the selected table.
15. On the table’s page, click the Data tab at the top of the window.
Results: After completing this exercise, you will be able to configure Entity Framework to initialize a new
database with seed data.
return Enumerable.Empty<string>();
9. At the end of the GetRegistrantNames method before the closing bracket, create a CloudTable
instance:
3. At the end of the GetRegistrantsNames method before the closing bracket, create a new instance of
the TableQuery class and use the fluent Where method with your filter to generate a query:
4. Pass the generated query into the ExecuteQuery method of the table variable using the
Registration model class as the generic parameter:
2. Append the lambda-syntax query with a fluent method to order the result by LastName:
3. Append the query further with a fluent method to order the result by FirstName:
4. Finalize the query with a projection method that uses the String.Format static method to format the
string with LastName, followed by a command, then a space and FirstName:
5. At the end of the GetRegistrantsNames method before the closing bracket, add the following
statement:
return names;
Results: After completing this exercise, you will be able to query entities by row key or partition key from
Table Storage.
MCT USE ONLY. STUDENT USE PROHIBITED
L7-9
5. In the RegisterController class, find the method with the following signature:
return Guid.Empty;
7. At the end of the StoreRegistration method before the closing bracket, get the connection string
using the CloudConfigurationManager.GetSetting static method and the
Microsoft.WindowsAzure.Storage.ConnectionString value as the parameter:
string connectionString =
CloudConfigurationManager.GetSetting("Microsoft.WindowsAzure.Storage.ConnectionString
");
8. Use the CloudStorageAccount.Parse static method with the connection string as the parameter to
get the storage account:
var storageAccount =
Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(connectionString);
9. At the end of the StoreRegistration method before the closing bracket, create a CloudTableClient
variable using the CreateCloudTableClient method of the storage account:
10. Using the GetTableReference method of the CloudTableClient variable and “EventRegistrations”
as the parameter, create a CloudTable variable:
11. At the end of the StoreRegistration method before the closing bracket, create a new
TableOperation using the TableOperation.Insert static method and the dynamic registration as the
parameter:
12. Using the CloudTable variable, invoke the Execute method passing the TableOperation as the
parameter:
table.Execute(operation);
13. At the end of the StoreRegistration method before the closing bracket, use the Guid.Parse static
method to parse the registration.RowKey string as a System.Guid:
MCT USE ONLY. STUDENT USE PROHIBITED
L7-10 Developing Microsoft Azure™ Solutions
14. Return the rowKey variable as the result of the StoreRegistration method.
return rowKey;
Task 2: Update the Register ViewModel to Retrieve the Dynamic Stub Registration
from the Table
1. In the Solution Explorer pane, expand the Shared solution folder.
4. In the RegisterViewModel class, locate the method with the following signature:
RegisterViewModel(string eventKey)
5. At the end of the RegisterViewModel constructor before the closing bracket, get the connection
string using the CloudConfigurationManager.GetSetting static method and the
Microsoft.WindowsAzure.Storage.ConnectionString value as the parameter:
string connectionString =
CloudConfigurationManager.GetSetting("Microsoft.WindowsAzure.Storage.ConnectionString
");
6. Use the CloudStorageAccount.Parse static method with the connection string as the parameter to
get the storage account:
var storageAccount =
Microsoft.WindowsAzure.Storage.CloudStorageAccount.Parse(connectionString);
7. At the end of the RegisterViewModel constructor before the closing bracket, create a
CloudTableClient variable using the CreateCloudTableClient method of the storage account:
9. At the end of the RegisterViewModel constructor before the closing bracket, store the eventKey in
a string variable named partitionKey:
11. At the end of the RegisterViewModel constructor before the closing bracket, create a new instance
of the TableQuery class and use the fluent Where method with your filter to generate a query:
12. Pass the generated query into the ExecuteQuery method of the table variable:
13. At the end of the RegisterViewModel constructor before the closing bracket, select the single
element in the enumerable of DynamicTableEntity objects:
this.RegistrationStub = DynamicEntity.GenerateDynamicItem(tableEntity);
Results: After completing this exercise, you will be able to use the Azure Storage SDK to retrieve and
create entities.
MCT USE ONLY. STUDENT USE PROHIBITED
L7-12 Developing Microsoft Azure™ Solutions
Exercise 3: Verify that the Events Web Site is using Azure Storage Tables
for Registrations
Task 1: Run the Data Generation Console Project to Populate the Azure Storage
Table with Data
1. In the Solution Explorer pane, expand the Shared solution folder.
Task 2: Use Server Explorer in Visual Studio 2013 to View Table Storage Registrations
1. On the View menu, click Server Explorer.
2. Locate the Windows Azure node and click the arrow immediately to the left.
3. Expand the Storage node under the Windows Azure node.
4. If prompted for your account credentials, login using your Microsoft Account.
5. Expand the Development account node under the Storage node.
Task 3: Debug the Cloud Web Project to Register for the Event
1. In the Solution Explorer pane, right-click the Contoso.Events.Cloud project and then click Set As
Startup Project.
3. If the Storage Emulator is already running, you will be prompted to shut down the emulator and
restart it using a different mode. Click OK.
4. On the home page of the web application, verify that it shows a list of events.
7. Fill out all of the fields in the registration form and click Submit.
Task 4: Use Server Explorer in Visual Studio 2013 to View the New Table Storage
Registration
1. On your desktop taskbar, locate the Contoso.Events - Visual Studio 2013 window.
6. In the yellow prompt asking if you would like to download the remaining entities, click the click here
hyperlink.
8. Click the Timestamp table header twice to sort entities in a descending order by their Timestamp.
Results: After completing this exercise, you will be able to leverage Visual Studio and the Azure emulators
to create a comprehensive development environment for Azure Storage.
MCT USE ONLY. STUDENT USE PROHIBITED
L7-14 Developing Microsoft Azure™ Solutions
MCT USE ONLY. STUDENT USE PROHIBITED
L8-1
2. Browse to https://portal.azure.com
3. In the Storage blade that appears, view your list of Storage instances.
4. In the list of Storage instances, locate your storage account with the prefix stor20532.
5. Click the name of your storage account to go to its dashboard.
6. In the stor20532[Your Name Here] blade that appears, click the Containers tile.
7. In the Containers blade that appears, view the list of your containers.
8. At the top of the blade, click the Add button.
15. Locate the Windows Azure node and click the arrow immediately to the left.
16. Expand the Storage node under the Windows Azure node.
Note: If you have not previously indicated that you would like Visual Studio to remember
your credentials, you will be prompted to enter your Microsoft Account username and
password to continue.
17. Expand the stor20532[Your Name] account node under the Storage node.
MCT USE ONLY. STUDENT USE PROHIBITED
L8-2 Developing Microsoft Azure™ Solutions
18. Expand the Blobs node under your storage account’s node.
20. In the Container tab, locate and click the Upload Blob button.
Note: The upload button iconography includes an arrow pointing up to a horizontal line.
26. In a new tab, type in the Url replacing [storage account] with the name of your storage account:
o http://[storage account].blob.core.windows.net/example/samplefile.txt
27. Verify that the text “This is your sample file!” shows up in the browser.
Results: After completing this exercise, you will be able to create a blob container using the Management
Portal and view blobs in the container.
MCT USE ONLY. STUDENT USE PROHIBITED
L8-3
Task 2: Add Word Documents to the Container After They are Created
1. In the BlobStorageHelper class, find the method with the following signature:
return null;
3. At the end of the CreateBlob method before the closing bracket, create a new CloudBlobContainer
for the signin container.
4. Call the CreateIfNotExists method of the CloudBlobContainer variable to ensure that the container
exists:
container.CreateIfNotExists();
5. At the end of the CreateBlob method before the closing bracket, create a new variable named
blobName:
string blobName;
6. Use the String.Format static method to create a string and assign the string to the blobName
variable:
7. At the end of the CreateBlob method before the closing bracket, create a block blob reference using
the GetBlockBlobReference method and the blobName variable as the parameter:
8. Use the Seek method of the MemoryStream variable to seek the Origin by 0 offset using the
beginning as the origin:
stream.Seek(0, SeekOrigin.Begin);
9. Use the UploadFromStream method of the ICloudBlob interface to upload the stream to the
referenced blob:
MCT USE ONLY. STUDENT USE PROHIBITED
L8-4 Developing Microsoft Azure™ Solutions
blob.UploadFromStream(stream);
10. At the end of the CreateBlob method before the closing bracket, add the following statement:
return blob.Uri;
Results: After completing this exercise, you will be able to use the Azure Storage SDK to manage blobs
and containers in your storage account.
MCT USE ONLY. STUDENT USE PROHIBITED
L8-5
4. In the DownloadViewModel class, find the method with the following signature:
6. At the end of the GetStream method before the closing bracket, create a new CloudBlobClient for
the _storageAccount variable.
7. Create a new CloudBlobContainer for the signin container using the CloudBlobClient variable.
8. Call the CreateIfNotExists method of the CloudBlobContainer variable to ensure that the container
exists:
container.CreateIfNotExists();
9. At the end of the GetStream method before the closing bracket, create a block blob reference using
the GetBlockBlobReference method and the _blobId variable as the parameter:
10. Use the OpenReadAsync method of the ICloudBlob variable to create a Stream and store it in a
variable:
11. At the end of the GetStream method before the closing bracket, create a new instance of the
DownloadPayload class:
12. Assign the Stream variable to the DownloadPayload variable’s Stream property:
payload.Stream = blobStream;
13. Assign the ICloudBlob variable’s Properties.ContentType value to the DownloadPayload variable’s
ContentType property:
payload.ContentType = blob.Properties.ContentType;
return payload;
5. Ensure that all of the remaining projects have their Action set to None.
6. Click OK to close the dialog
8. In the Windows quick launch tray, click on the arrow to see the running tray icons.
9. Locate the IIS Express icon and right-click the tray icon.
10. Hover over the Contoso.Events.Management option under the View Sites header, then click the
URL under the Browse Applications header.
11. On the home page for the Administration web application, click the button to go to the list of
events.
12. Click the Sign-In Sheet button for any event in the list.
13. View the sign-in page which notifies you that a sign-in sheet is being generated.
14. Wait 1-2 minutes, then refresh the sign-in sheet page.
15. Click the Sign-In Sheet hyperlink to download the sign-in sheet from the server.
Results: After completing this exercise, you will be able to download blobs from your storage account
using the Azure Storage SDK.
MCT USE ONLY. STUDENT USE PROHIBITED
L8-7
4. Locate the Windows Azure node and click the arrow immediately to the left.
10. Ensure that the value of the Public Read Access property is Off.
6. At the end of the GetSecureUrl method before the closing bracket, create a new CloudBlobClient
for the _storageAccount variable.
7. Create a new CloudBlobContainer for the signin container using the CloudBlobClient variable.
8. Call the CreateIfNotExists method of the CloudBlobContainer variable to ensure that the container
exists:
container.CreateIfNotExists();
9. At the end of the GetSecureUrl method before the closing bracket, create a new instance of the
SharedAccessBlobPolicy class:
blobPolicy.SharedAccessExpiryTime = DateTime.Now.AddHours(0.25d);
blobPolicy.Permissions = SharedAccessBlobPermissions.Read;
12. At the end of the GetSecureUrl method before the closing bracket, create a new instance of the
BlobContainerPermissions class:
blobPermissions.SharedAccessPolicies.Add("ReadBlobPolicy", blobPolicy);
blobPermissions.PublicAccess = BlobContainerPublicAccessType.Off;
15. At the end of the GetSecureUrl method before the closing bracket, call the asynchronous
SetPermissionsAsync method of the CloudBlobContainer variable using the
BlobContainerPermissions variable as the parameter:
await container.SetPermissionsAsync(blobPermissions);
16. Invoke the GetSharedAccessSignature method of the CloudBlobContainer variable using a new
instance of the SharedAccessBlobPolicy class as the first parameter and the “ReadBlobPolicy” key
as the second parameter:
17. At the end of the GetSecureUrl method before the closing bracket, create a block blob reference
using the GetBlockBlobReference method and the _blobId variable as the parameter:
18. Take the Uri property of the ICloudBlob variable and store it in a new Uri variable.
19. At the end of the GetSecureUrl method before the closing bracket, concatenate the AbsoluteUri of
the Uri variable and the sasToken variable:
return secureUrl;
Task 3: Download Documents from a Protected Container using the SAS Token
1. On the DEBUG menu, click Start Debugging.
MCT USE ONLY. STUDENT USE PROHIBITED
L8-9
2. In the Windows quick launch tray, click on the arrow to see the running tray icons.
3. Locate the IIS Express icon and right-click the tray icon.
4. Hover over the Contoso.Events.Management option under the View Sites header, then click the
URL under the Browse Applications header.
5. On the home page for the Administration web application, click the button to go to the list of
events.
6. Click the Sign-In Sheet button for any event in the list.
7. View the sign-in page which notifies you that a sign-in sheet is being generated.
Results: After completing this exercise, you will be able to modify the permissions of containers and
generate SAS Tokens for the containers.
MCT USE ONLY. STUDENT USE PROHIBITED
L8-10 Developing Microsoft Azure™ Solutions
MCT USE ONLY. STUDENT USE PROHIBITED
L9-1
Note: Service Bus functionality is not available yet in the new Preview Portal. Because of
this, the existing Management Portal will be used for this lab.
2. Browse to https://manage.windowsazure.com
3. Enter your Microsoft Account e-mail and password and then click Sign In.
4. In the navigation pane on the left side, scroll down and click Service Bus.
8. In the Region list, select the region that is closest to your location.
12. Record the connection string from the ACS Connection String field.
Note: Here you will be recording three items. First you will record the ACS Connection
String. Next you will record the Default Issuer and Default Key.
15. At the bottom left of the screen, click the New button.
16. If it is not automatically selected, select App Services => Service Bus => Queue => Custom
Create.
18. In the Queue Name dialog box, provide the value signin.
19. In the Region list, select the region that is closest to you.
MCT USE ONLY. STUDENT USE PROHIBITED
L9-2 Developing Microsoft Azure™ Solutions
20. In the Namespace dialog box, provide the value sb20532[Your Name].
21. Click the next arrow to move to the next step in the wizard.
Results: After completing this exercise, you will be able to create a Service Bus Namespace using the
Azure Management Portal.
MCT USE ONLY. STUDENT USE PROHIBITED
L9-3
7. At the end of the TableStorageQueueHelper constructor before the closing bracket, store the
StorageAccount property from the base class in a CloudStorageAccount variable.
8. Invoke the CreateCloudQueueClient method and assign the result to the _queueClient variable.
_queueClient = storageAccount.CreateCloudQueueClient();
9. Invoke the static CloudConfigurationManager.GetSetting method and assign the result to the
_signInQueueName variable.
_signInQueueName = CloudConfigurationManager.GetSetting("SignInQueueName");
10. In the TableStorageQueueHelper class, find the constructor with the following signature:
IQueueMessage<CloudQueueMessage> Receive()
12. At the end of the Receive method before the closing bracket, create a new instance of the
CloudQueue class by calling the GetQueueReference method of the CloudQueueClient variable
using the string name of the queue.
13. Invoke the CreateIfNotExists method to ensure that the queue exists.
queue.CreateIfNotExists();
14. At the end of the Receive method before the closing bracket, invoke the GetMessage method of the
CloudQueue class and store the result in a CloudQueueMessage variable.
15. Pass the CloudQueueMessage variable into the constructor of the TableStorageQueueMessage
class and return the result.
16. At the end of the CompleteMessage method before the closing bracket, create a new instance of the
CloudQueue class by calling the GetQueueReference method of the CloudQueueClient variable
using the string name of the queue.
17. Invoke the CreateIfNotExists method to ensure that the queue exists.
queue.CreateIfNotExists();
18. At the end of the CompleteMessage method before the closing bracket, invoke the DeleteMessage
method using the CloudQueueMessage variable as the parameter.
queue.DeleteMessage(message);
CloudStorageAccount storageAccount =
CloudStorageAccount.Parse(tableStorageConnectionString);
5. Create a new instance of the CloudQueueClient class using the CreateCloudQueueClient method
of the CloudStorageAccount variable.
6. After the previous code, create a new instance of the CloudQueue class by invoking the
GetQueueReference method of the CloudQueueClient variable using the queue name string
variable.
7. Invoke the CreateIfNotExists method of the CloudQueue class to ensure that the queue exists.
queue.CreateIfNotExists();
8. After the previous code, create a new instance of the CloudQueueMessage class by passing in the
string message into the constructor.
9. Invoke the AddMessage method of the CloudQueue variable using the CloudQueueMessage as
the parameter:
queue.AddMessage(queueMessage);
7. Ensure that all of the remaining projects have their Action set to None.
10. In the Windows quick launch tray, click on the arrow to see the running tray icons.
11. Locate the IIS Express icon and right-click the tray icon.
12. Hover over the Contoso.Events.Management option under the Web Sites header, then click the
URL under the Browse Applications header.
13. On your desktop, click the Contoso.Events - Visual Studio 2013 window.
14. In the Solution Explorer pane, expand the Roles folder.
18. After the check to see if the SourceMessage property of the brokeredMessage variable is null,
locate the try-catch block within that conditional.
19. Locate the target line of code within the try-catch block:
HandleMessage(message);
20. Right-click the target line of code, hover over Breakpoint and click Insert Breakpoint.
23. Click the Sign-In Sheet button for any event in the list.
24. View the sign-in page which notifies you that that sign-in sheet is being generated with the message:
Sign-In Document Generation in Progress.
25. Wait 1 minute for the worker role to receive the queue message.
26. Verify that the breakpoint is hit and execution temporarily pauses.
MCT USE ONLY. STUDENT USE PROHIBITED
L9-6 Developing Microsoft Azure™ Solutions
29. Click the Sign-In Sheet link to download the sign-in sheet from the server.
Results: After completing this exercise, you will be able to create and consume messages from Azure
Storage Queues.
MCT USE ONLY. STUDENT USE PROHIBITED
L9-7
8. At the end of the ServiceBusQueueHelper constructor, before the closing bracket, store the
Microsoft.ServiceBus.ConnectionString setting value from your Cloud configuration in a string
variable.
string serviceBusConnectionString =
CloudConfigurationManager.GetSetting("Microsoft.ServiceBus.ConnectionString");
10. Invoke the static QueueClient.CreateFromConnectionString method using the queue name and
connection string as parameters and assign the result to the _client variable.
_client = QueueClient.CreateFromConnectionString(serviceBusConnectionString,
signInQueueName);
11. In the ServiceBusQueueHelper class, find the method with the following signature:
IQueueMessage<BrokeredMessage> Receive()
13. At the end of the Receive method before the closing bracket, create a new instance of the
CloudQueue class by calling the GetQueueReference method of the CloudQueueClient variable
using the string name of the queue.
14. Invoke the CreateIfNotExists method to ensure that the queue exists.
15. At the end of the CompleteMessage method before the closing bracket, invoke the Complete
method on the message parameter.
message.Complete();
16. At the end of the AbandonMessage method before the closing bracket, invoke the Abandon
method on the message parameter.
MCT USE ONLY. STUDENT USE PROHIBITED
L9-8 Developing Microsoft Azure™ Solutions
message.Abandon();
20. Locate and replace the line of code creating the TableStorageQueueHelper:
10. Replace the above line of code with the following line of code:
11. At the beginning of the GenerateSignInSheetServiceBus method after the opening bracket, create a
QueueClient instance using the connection string.
QueueClient client =
QueueClient.CreateFromConnectionString(serviceBusConnectionString, signInQueueName);
12. After the previous code, create a new instance of the BrokeredMessage class by passing in the
QueueMessage message into the constructor.
13. Invoke the Send method of the QueueClient variable using the BrokeredMessage as the parameter.
client.Send(queueMessage);
2. In the Windows quick launch tray, click on the arrow to see the running tray icons.
3. Locate the IIS Express icon and right-click the tray icon.
4. Hover over the Contoso.Events.Management option under the Web Sites header, then click the
URL under the Browse Applications header.
10. After the check to see if the SourceMessage property of the brokeredMessage variable is null,
locate the try-catch block within that conditional.
11. Locate the target line of code within the try-catch block:
HandleMessage(message);
12. Right-click the target line of code, hover over Breakpoint and click Insert Breakpoint.
13. On your desktop, click the Home - Contoso.Events.Administration window.
14. On the home page for the Administration web application, click the button to go to the list of
events.
15. Click the Sign-In Sheet button for any event in the list.
16. View the sign-in page which notifies you that that sign-in sheet is being generated with the message:
Sign-In Document Generation in Progress.
17. Wait 1 minute for the worker role to receive the queue message.
18. Verify that the breakpoint is hit and execution temporarily pauses.
21. Click the Sign-In Sheet link to download the sign-in sheet from the server.
Results: After completing this exercise, you will be able to create and consume messages from Azure
Storage Queues.
MCT USE ONLY. STUDENT USE PROHIBITED
L9-10 Developing Microsoft Azure™ Solutions
Exercise 4: Use Service Bus Relay to Connect a WCF Service and Client[s]
Task 1: Test the Existing WCF Service using a Console Application
1. On the Windows Start screen, click Desktop.
8. In the Solution Explorer pane, expand the On-Premise folder, right-click the
Contoso.Events.Lodging project and then click Set as Startup Project.
12. On your desktop, click the Contoso.Events.Lodging.Client - Visual Studio 2013 window.
13. On the DEBUG menu, click Start Debugging.
16. On your desktop, click the Contoso.Events - Visual Studio 2013 window.
Task 2: Modify the WCF Service Endpoints to use Service Bus Relay
1. On your desktop, click the Contoso.Events - Visual Studio 2013 window.
2. In the Solution Explorer pane, expand the On-Premise folder.
9. Replace the value of the binding attribute with the value: netTcpRelayBinding.
10. Locate the first endpoint child XML element with a contract value of
Contoso.Events.Models.ILodgingService.
MCT USE ONLY. STUDENT USE PROHIBITED
L9-11
11. Replace the value of the address attribute with the value: sb://.
12. Append the address attribute’s value with the name of your namespace.
13. Append the address attribute’s value with the value: .servicebus.windows.net/lodging.
<behavior name="ServiceBusRelayBehavior">
</behavior>
18. Within the tags of the behavior element, add a transportClientEndpointBehavior element:
<transportClientEndpointBehavior>
</transportClientEndpointBehavior>
19. Within the tags of the transportClientEndpointBehavior element, add a tokenProvider element:
<tokenProvider>
</tokenProvider>
20. Within the tags of the tokenProvider element, add a sharedSecret element with the issuerName
attribute’s value set to owner:
21. Within the sharedSecret element, remove the value of the issuerSecret attribute.
22. Replace the value of the issuerSecret attribute with your Default Key recorded in the previous task.
3. The WCF service will prompt that it does not have any metadata. Click No to continue with the
debugging process.
9. Replace the line with a line of code that creates a Uri by invoking the static method
ServiceBusEnvironment.CreateServiceUri with the protocol, namespace and relative name as it’s
parameters:
MCT USE ONLY. STUDENT USE PROHIBITED
L9-12 Developing Microsoft Azure™ Solutions
10. On the previous line of code, update the parameters for the CreateServiceUri method by replacing
the “[namespace]” string with your Service Bus namespace.
new NetTcpBinding(),
12. Replace the line with a line of code that creates a new instance of the NetTcpRelayBinding class:
new NetTcpRelayBinding(),
14. On the next line, set the TransportClientEndpointBehavior variable’s TokenProvider property to
the result of an invocation of the TokenProvider.CreateSharedSecretTokenProvider static method.
endpointBehavior.TokenProvider =
TokenProvider.CreateSharedSecretTokenProvider("owner", "[key]");
15. On the previous line of code, update the parameters for the CreateSharedSecretTokenProvider
method by replacing the “[key]” string with the key for your Service Bus namespace and the
“owner” string with the issuer for your Service Bus namespace (this is likely the same value).
16. Add the new instance of the TransportClientEndpointBehavior to the EndpointBehaviors
collection property of the Endpoint.
cf.Endpoint.EndpointBehaviors.Add(endpointBehavior);
19. Type any key into the console window to close the window.
Task 4: Updating the Cloud Web Application to Connect to the Relayed WCF Service
1. Locate the method with the following signature.
3. Copy the entire method by right-clicking the selection and clicking Copy.
11. Paste the entire method by right-clicking the selection and clicking Paste.
13. In the Solution Explorer pane, right-click the Contoso.Events.Data.Generation project, highlight
Debug and then click Start New Instance.
Note: You may have to use the down arrow to locate the Visual Studio 2013 tile in your
Start screen. Once you launch the application in the Administrator context, you may see the UAC
prompt. Select Yes to continue.
16. On the FILE menu, hover over the Open option and then click Project/Solution.
17. In the Open Project dialog, do the following:
23. On the home page of the web application, click any event.
24. On the event details page, click the Register Now button.
MCT USE ONLY. STUDENT USE PROHIBITED
L9-14 Developing Microsoft Azure™ Solutions
27. Observe that the Registration Confirmation web page shows a list of hotels.
Results: After completing this exercise, you will be able to connect existing WCF applications to clients
using Service Bus Relay.
MCT USE ONLY. STUDENT USE PROHIBITED
L10-1
2. In the Address bar, type in the following url and press Enter:
o http://go.microsoft.com/fwlink/p/?linkid=320376
Note: You will notice that Internet Explorer blocks the download popup. You will need to
view the yellow warning message at the bottom of the Internet Explorer window, click Options
for this Site and then click Always Allow. This will allow you to view popups and downloads
without any restriction.
3. At the bottom of the Internet Explorer window, click the Run button in the download dialog.
4. Verify that the package is named Windows Azure PowerShell.
5. Click Install.
6. Click I Accept.
Note: The download and installation of the Module takes about 5 minutes.
9. Click Exit.
3. To get your publish settings file, type the following command in the console and press Enter:
Get-AzurePublishSettingsFile
9. At the bottom of the Internet Explorer window, click the arrow to the right of the Save button and
then click Save As in the download dialog.
13. In the Save as type dialog, ensure that the PUBLISHSETTINGS File option is selected.
Import-AzurePublishSettingsFile E:\Mod10\Labfiles\20532.publishsettings
18. To view your account details, type the following command in the console and press Enter:
Get-AzureAccount
Note: If you have multiple Azure subscriptions, you can use Select-AzureSubscription to
select the correct subscription to use.
If your Azure subscription was provided by a Learning Partner it may be an auto-generated
account without any “details”. In this case, this command would return an empty result.
Results: After completing this exercise, you will be able to setup a development environment to use
PowerShell for Azure service automation.
MCT USE ONLY. STUDENT USE PROHIBITED
L10-3
Note: It is possible to get an error message that your Website’s name is not unique. If
this occurs, just select a new name until your Website is created.
2. To get your list of Websites, type the following command in the console and press Enter:
Get-AzureWebsite
3. To get the details for your new Website, type the following command in the console and press Enter
providing the unique name selected for your website:
4. Record the hostname value from the list of key-value pairs generated by the previous command.
5. To view the new Website in Internet Explorer, type the following command in the console and press
Enter:
2. To get your list of Websites, type the following command in the console and press Enter:
Get-AzureWebsite
3. To remove your new Website, type the following command in the console and press Enter providing
the unique name selected for your website:
4. Type Y to indicate that you want to remove the website and then press Enter.
5. To verify that your Website was removed, type the following command in the console and press
Enter providing the unique name selected for your website. The result should be empty:
Results: After completing this exercise, you will be able to use PowerShell to manage instances of an
Azure service.
MCT USE ONLY. STUDENT USE PROHIBITED
L10-5
2. Switch-AzureMode AzureResourceManager
Add-AzureAccount
Get-AzureAccount
Note: If you have multiple Azure subscriptions, you can use Select-AzureSubscription to
select the correct subscription to use.
2. To create a new instance of a resource group from the template, type the following command in the
console and press Enter:
4. For the siteName prompt, supply the value rs20532a[Your Name Here] and press Enter.
5. For the hostingPlanName prompt, supply the value rp20532a[Your Name Here] and press Enter.
6. For the siteLocation prompt, supply the value West US and press Enter.
7. For the serverName prompt, supply the value rv20532a[Your Name Here] and press Enter.
8. For the serverLocation prompt, supply the value West US and press Enter.
9. For the administratorLogin prompt, supply the value testuser and press Enter.
10. For the administratorLoginPassword prompt, supply the value TestPa$$w0rd and press Enter.
MCT USE ONLY. STUDENT USE PROHIBITED
L10-6 Developing Microsoft Azure™ Solutions
11. For the databaseName prompt, supply the value rd20532a[Your Name Here] and press Enter.
Note: Please wait for the provisioning process to complete. Status messages will be
displayed periodically and a final details message will be shown when provisioning is complete.
12. To get the details for your new Resource Group, type the following command in the console and
press Enter providing the unique name selected for your website:
13. To get the details for your new Website, type the following command in the console and press Enter
providing the unique name selected for your website:
14. Record the single value in the hostNames array from the JSON data generated by the previous
command.
15. To view the new Website in Internet Explorer, type the following command in the console and press
Enter:
2. Type Y to indicate that you want to remove the website and then press Enter.
Note: Since removing a Resource Group involves removing multiple resources, this process
can take anywhere from 10-15 minutes.
Results: After completing this exercise, you will be able to use Azure to interact with the Resource
Manager, resource groups and resource group templates.
MCT USE ONLY. STUDENT USE PROHIBITED
L11-1
Note: For this lab, we will use the Management Portal since the functionality to create new
Azure Active Directory domains is not available in the Preview Portal.
2. Browse to https://manage.windowsazure.com
1. Enter your Microsoft Account e-mail and password and then click Sign In.
5. In the TYPE OF USER list, select the value New user in your organization.
8. Click the right arrow to move to the next step in the wizard.
11. In the DISPLAY NAME dialog box, provide the value Admin User.
13. In the Alternate Email Address dialog box, provide the value example@contoso.com.
16. On the Get Temporary Password screen, click the Create button to create the user.
17. Record the temporary password that was generated for the user.
6. Click the right arrow to move to the next step in the wizard.
13. On the Get Temporary Password screen, click the Create button to create the user.
14. Record the temporary password that was generated for the user.
15. Click the checkmark button to complete the wizard.
Results: After completing this exercise, you will be able to create an Azure AD Directory and populate
that directory with users.
MCT USE ONLY. STUDENT USE PROHIBITED
L11-3
9. In the line above the class definition add the Authorize attribute:
[Authorize]
Results: After completing this exercise, you will be able to use MVC to require a user to be logged in
before accessing a controller or action.
MCT USE ONLY. STUDENT USE PROHIBITED
L11-4 Developing Microsoft Azure™ Solutions
Note: The original IIS 8.0 Express installation with Visual Studio 2013 Update 3 can be
corrupted when you image your machine and recreate the machine with a new user. IIS Express
depends on configuration files that are located in your user’s Documents folder. When the
machine is imaged, the old user account is lost and a new user account is created when you
create a new VM from the image. Repairing the installation will create the configuration files for
your new user.
1. In the Windows start screen, click the down arrow and then click the Run tile.
2. In the Run dialog, do the following:
6. Locate the IIS 8.0 Express item in the list of Currently installed programs.
7. Right-click the IIS 8.0 Express item and then click Repair.
8. Wait for the Repair process to complete. The process is complete when the popup window closes.
Task 2: Create a New Management Web Application using Azure AD as the Identity
Provider
1. In the Solution Explorer pane, right-click the Administration solution folder, hover over Add and
then click New Project….
10. Ensure the Microsoft Azure – Host in the Cloud checkbox is unselected.
13. In the Change Authentication dialog, select the Organizational Accounts option.
14. In the Domain dialog box, provide the value ad20532[Your Name].onmicrosoft.com.
Note: The screens shown during login may vary depending on whether you have logged in
using that domain lately or have set up IE to remember a specific login.
17. Login using the Admin User account (admin@ad20532[Your Name].onmicrosoft.com) and
temporary password created earlier in this lab.
19. Back in the New ASP.NET Project – Contoso.Events.Management dialog, click the OK button.
21. Right-click the Contoso.Events.Management project and click Set as StartUp Project.
o Content
o Controllers
o Fonts
o Scripts
o Views
Note: You can copy all of the folders at once by holding the Shift key and clicking the
App_Start folder and then the Views folder. This will select all six folders at the same time. You
can then use the context menu or Ctrl+C shortcut keys to copy the folders.
32. Paste all of the copies folders into the Contoso.Events.Management project.
33. When prompted to Merge Folders, click Apply to all items and then click Yes.
34. When prompted with Destination File Exists, click Apply to all items and then click Yes.
MCT USE ONLY. STUDENT USE PROHIBITED
L11-6 Developing Microsoft Azure™ Solutions
Task 3: Verify that the Management Web Application Requies Login using a
Organizational Account
1. In the Solution Explorer pane, right-click the Contoso.Events.Management project and click Set as
Startup Project.
5. Login using the Standard User account and temporary password created earlier in this lab.
6. In the Change Password dialog, update your password to Pa$$w0rd.
Results: After completing this exercise, you will be able to use an Azure AD domain with the ASP.NET
Identity framework.
MCT USE ONLY. STUDENT USE PROHIBITED
L12-1
2. Browse to https://portal.azure.com
3. In the bottom left corner of the portal, click the New button.
4. In the New blade that appears, click the SQL Database link.
5. In the SQL database blade that appears, do the following:
6. In the Name dialog box, provide the value dp20532a[Your Name Here].
7. Click the Pricing Tier link.
8. In the Recommended pricing tier blade that appears, select the Web option.
12. In the New Server blade that appears, locate the Server Name dialog box.
13. In the Server Name dialog box, provide the value sp20532a[Your Name Here].
14. In the Server Admin Login dialog box, provide the value testuser.
18. In the Location blade that appears, select the region that is closes to your location.
19. In the New server blade, click the OK button.
20. In the SQL database blade, click the Create button to create the SQL Database and Server.
MCT USE ONLY. STUDENT USE PROHIBITED
L12-2 Developing Microsoft Azure™ Solutions
Note: Once your SQL Database instance is created, a tile will appear on your Startboard
(home screen) to access the blade for your database.
21. Click the tile for the new SQL Database on the Startboard.
22. In the dp20532a[Your Name Here] blade that appears, click the Properties tile.
23. In the Properties blade that appears, click the Show database connection strings link.
24. In the Database connection strings blade that appears, locate the ADO.NET dialog box.
25. Copy the connection string.
29. In the Notepad application, replace the text {Your_password_here} with the text TestPa$$w0rd.
31. Close the dp20532a[Your Name Here] blade by clicking the x button at the top of the blade.
3. In the Storage blade that appears, view your list of Storage instances.
4. At the bottom left corner of the screen, click New.
5. In the New blade that appears, click the Storage link near the bottom.
9. In the Location blade, select the region closest to your current location.
10. Click the Pricing Tier link.
11. In the Recommended Pricing Tiers blade, select the L1 LRS option for local redundancy.
14. Note: Once your Storage instance is created, a tile will appear on your Startboard (home
screen) to access the blade for your storage instance.
15. Click the tile for the new Storage on the Startboard.
16. In the sp20532a[Your Name Here] blade that appears, click the Properties tile.
17. In the Properties blade that appears, copy the Name at the top of the blade.
19. Close the Properties blade by clicking the x button at the top of the blade.
20. In the sp20532a[Your Name Here] blade, click the Keys tile.
MCT USE ONLY. STUDENT USE PROHIBITED
L12-3
21. In the Manage keys blade that appears, copy the Primary Access Key.
24. Close the sp20532a[Your Name Here] blade by clicking the x button at the top of the blade.
4. In the Namespace Name dialog box, provide the value sp20532a[Your Name].
5. In the Region list, select the region that is closest to your location.
Note: Once your namespace is created, an item will appear on the list of Service Bus
namespaces.
10. Copy the connection string and paste the connection string in the Notepad application.
Results: After completing this exercise, you will be able to create services that will be used for your
deployed web application.
MCT USE ONLY. STUDENT USE PROHIBITED
L12-4 Developing Microsoft Azure™ Solutions
4. In the Solution Explorer pane, expand the Contoso.Events.Cloud project, expand the Roles folder
and then double-click the Contoso.Events.Worker role.
10. Locate the Service Configuration list at the top of the page.
11. Select the value Cloud.
12. Locate the setting with the name Microsoft.WindowsAzure.Storage.ConnectionString.
13. In the Value dialog box, click the button on the right hand side with three ellipsis.
Note: If you have not previously saved your Microsoft Account credentials, you will be
required to login at this point.
16. In the Account name dialog box, provide the Storage Account Name value recorded in the
previous task.
17. In the Account key dialog box, provide the Primary Access Key value recorded in the previous task.
18. Leave the Connection option to the default setting: Use HTTPS (Recommended).
20. Copy the connection string from the Value dialog box.
26. Locate the Service Configuration list at the top of the page.
MCT USE ONLY. STUDENT USE PROHIBITED
L12-5
28. Verify that both of the storage settings have a value of UseDevelopmentStorage=true.
29. In the Solution Explorer pane, expand the Contoso.Events.Cloud project, expand the Roles folder
and then double-click the Contoso.Events.Web role.
30. On the left-hand side of the screen, click the Settings tab.
31. Locate the Service Configuration list at the top of the page.
34. In the Value dialog box, click the button on the right hand side with three ellipsis.
37. In the Account name dialog box, provide the Storage Account Name value recorded in the
previous task.
38. In the Account key dialog box, provide the Primary Access Key value recorded in the previous task.
39. Leave the Connection option to the default setting: Use HTTPS (Recommended).
43. Paste the copied value into the Value dialog box.
44. Locate the Service Configuration list at the top of the page.
45. Select the value Local.
46. Verify that both of the storage settings have a value of UseDevelopmentStorage=true.
Task 2: Modify the Web.config Transformation File for the Administration Project
1. In the Solution Explorer pane, expand the Administration solution folder, expand the
Contoso.Events.Management project, expand the Web.config files and then double-click the
Web.Debug.config file.
4. Update the value attribute of the element to the storage connection string recorded in the previous
task.
5. Locate the appSettings xml element.
6. Locate the add child xml element with a key attribute of Microsoft.ServiceBus.ConnectionString.
7. Update the value attribute of the element to the ACS Connection String recorded in the first task.
8. Locate the connectionStrings xml element.
9. Locate the add child xml element with a name attribute of EventsContextConnectionString.
MCT USE ONLY. STUDENT USE PROHIBITED
L12-6 Developing Microsoft Azure™ Solutions
10. Update the connectionString attribute of the element to the ADO.NET Connection String recorded
in the first task.
Task 3: Modify the app.config File for the Worker Role Project
1. In the Solution Explorer pane, expand the Roles solution folder, expand the
Contoso.Events.Worker project and then double-click the app.config file.
3. Locate the add child xml element with a name attribute of EventsContextConnectionString.
4. Update the connectionString attribute of the element to the ADO.NET Connection String recorded
in the first task.
Task 4: Modify the Web.config Transformation File for the Web Role Project
1. In the Solution Explorer pane, expand the Roles solution folder, expand the Contoso.Events.Web
project, expand the Web.config file and then double-click the Web.Release.config file.
2. Locate the connectionStrings xml element.
3. Locate the add child xml element with a name attribute of EventsContextConnectionString.
4. Update the connectionString attribute of the element to the ADO.NET Connection String recorded
in the first task.
Results: After completing this exercise, you will be able to make changes to your web applications so that
they will use different settings and connection strings after they are deployed to the cloud.
MCT USE ONLY. STUDENT USE PROHIBITED
L12-7
4. Locate the Cloud Service list and select the Create New value.
7. In the Region or Affinity Group dialog box, select the region that is closest to your location.
Task 2: Deploy the ASP.NET Web Application Project to a Web Site Instance
1. On the View menu, click Server Explorer.
2. Locate the Windows Azure node and click the arrow immediately to the left.
3. Right-click the Web Sites node under the Windows Azure node and click “Create New Site”.
4. In the Site name dialog box, create a unique name for your website using this format:
ws20532[Your Name].
5. In the Region list, select the region that is closest to your location.
6. In the Database server list, ensure that the No database value is selected.
7. Click Create.
8. In the Solution Explorer pane, expand the Administration solution folder, right-click the
Contoso.Events.Management project and then click Publish.
9. On the Profile page of the wizard, select Windows Azure Web Sites as the publish target.
11. Select your new website from the Existing Web Sites list with the prefix ws20532.
13. You will be prompted with a dialog to save changes to your current publish profile. Click Yes to save.
14. On the Connection page of the wizard, click the Next button to move to the Settings page of the
wizard.
15. On the Settings page of the wizard, change the Configuration list’s value to Debug – Any CPU.
17. After the publish process is complete, verify that Internet Explorer opens up and navigates to the new
website.
Results: After completing this exercise, you will be able to deploy projects to both Azure Web Sites and
Cloud Services.
MCT USE ONLY. STUDENT USE PROHIBITED
L12-9
2. Locate the Windows Azure node and click the arrow immediately to the left.
3. Expand the Web Sites node under the Windows Azure node.
4. Right-click the website node beginning with the prefix ws20532 and then click View Settings.
8. Locate the WebSite node in Server Explorer beginning with the prefix ws20532.
9. Right-click the website node beginning with the prefix ws20532 and then click View Streaming
Logs.
10. Locate the WebSite node in Server Explorer beginning with the prefix ws20532.
11. Right-click the website node beginning with the prefix ws20532 and then click View in Browser.
12. In Internet Explorer, view the Contoso Events Administration homepage and then click the Go to
Events List button.
14. Verify that the Console pane has two entries, one from viewing the Index page of the website and
one from viewing the Events page of the website.
15. Close the Internet Explorer application.
Results: After completing this exercise, you will be able to view a live stream of the Trace logs for an
Azure Web Site.
MCT USE ONLY. STUDENT USE PROHIBITED
L12-10 Developing Microsoft Azure™ Solutions
MCT USE ONLY. STUDENT USE PROHIBITED
Notes
MCT USE ONLY. STUDENT USE PROHIBITED
Notes
MCT USE ONLY. STUDENT USE PROHIBITED
Notes
MCT USE ONLY. STUDENT USE PROHIBITED
Notes
MCT USE ONLY. STUDENT USE PROHIBITED
Notes
MCT USE ONLY. STUDENT USE PROHIBITED
Notes
MCT USE ONLY. STUDENT USE PROHIBITED
Notes
MCT USE ONLY. STUDENT USE PROHIBITED
Notes
MCT USE ONLY. STUDENT USE PROHIBITED
Notes
MCT USE ONLY. STUDENT USE PROHIBITED
Notes