Professional Documents
Culture Documents
Deploy Log Scroll Down Complated
Deploy Log Scroll Down Complated
Note: If you want to skip the overview and configuration exercises and go straight to a live
demonstration in action, you can start with Exercise 4. If you are new to Release Management,
however, it is recommended that you at least read the first few exercises for some background
information.
Prerequisites
In order to complete this lab you will need the Visual Studio 2015 virtual machine provided by Microsoft.
For more information on acquiring and using this virtual machine, please see this blog post.
Exercises
This hands-on lab includes the following exercises:
1. Release Management Overview
2. Configuring Release Management
3. Defining a Release Path and Template
4. Release Automation Example
5. (optional) Release Management Support for Azure and DSC
Figure 1
Release Management components
Note: There is also the option of deploying to environments that support DSC (Desired State
Configuration). In this case, without a deployment agent running on the target servers, the
release operation would push deployment bits to the target servers.
Release Management Server. The server component is the heart of the solution and consists of
the database, the workflow controller, and a dispatcher that synchronizes activities with the
target servers.
Release Management Client. The client comes in two flavors, a Windows Presentation
Foundation (WPF) based client that exposes all the functionalities of the application and a web-
client designed for testers, user acceptance approvers and managers.
Microsoft Deployment Agent. The deployment agent is a service that is installed on the target
servers where the application components need to be deployed. It is important to note that the
Release Management Server does not require access to the target servers as all operations are
based on a pull mechanism from the deployment agent.
Deployment Tools. The Release Management solution provides various installation tools that
assist different deployment scenarios such as uninstalling/installing components, deploying
reports to Microsoft SQL Reporting Services, and moving files to specific locations.
Note: This self-contained virtual machine has all Release Management components installed
on it for demonstration purposes, including the deployment service.
2. Select the Previously Approved link and note that there were releases triggered by a build of
the Fabrikam Call Center.
Figure 3
Viewing previous approvals
3. Select the link displaying the number of deployed components (just underneath the name Brian
Keller).
Figure 4
Location of components link
4. This shows us the components that were deployed during each stage of the release path. In this
particular case, it was just a specific build of a web site.
Figure 5
Viewing components deployed
Figure 6
Location of stages link
7. This dialog window shows the workflow steps and results that occurred in the “Prod”
(production) stage. It was manually accepted from the previous stage by Brian Keller,
automatically installed to the deployment environment, and finally validated by Brian once
again.
Figure 7
“Prod” stage historical workflow
Figure 8
Location of Previous Stage link
9. This stage was setup to be for QA. Note that this stage has more workflow automation in place
– it automatically accepts, installs, and validates the application and then waits for a QA team
member to approve it.
Figure 9
“QA” stage historical workflow
Note: The setup used for the stages seen in this lab are for demonstration purposes only. In
normal scenarios, the QA stage would not automate the acceptance step. It would usually be
setup for an owner of that stage to decide when to deploy a new version.
10. Select the Previous Stage link to view the “Dev” (development) stage history. There is quite a
bit of automation going on here as well, but note that manual approval was necessary in order
for transition to the QA stage. This final approver simply indicates that the current version
meets all needed quality gates and should be made available to the next stage (QA in this case).
We will see how all of this is configured later on in this lab, but for now just remember that the
flow through the different stages (Dev -> QA -> Prod) is what we refer to as the release path.
Figure 10
“Dev” stage historical workflow
Figure 11
Release Management client splash screen
2. By default, Release Management will load the Traffic Overview tab which shows deployments
moving through all release paths and stages. This shows us that the Fabrikam Call Center
application has already had a deployment go through each stage of deployment without any
failures.
Figure 12
Traffic overview
3. Let’s take a quick look at some of the main configuration tasks that need to be addressed when
installing and configuring Release Management. Select the Administration tab followed by the
Manage TFS link.
Figure 13
TFS connection configuration
Figure 14
Loading configuration for TFS connection
5. This connection was setup in the virtual machine ahead of time, but it is important to note that
the user account used by Release Management needs to have the “Make requests on behalf of
others” permission within TFS.
Figure 15
Configuring account to connect to TFS
6. Other important settings can be configured in Administration | Settings. The System System
Settings tab (default) shows various timeouts, version information, SMTP configuration, and
license information. These settings are all defaults that were set during the creation of this
virtual machine.
Figure 16
System settings
7. Select the Deployer Settings tab to view the configuration options for all deployer services. For
example, you can set how often you want the deployment agent to poll the Release
Management server for packages to deploy.
Figure 17
Deployer settings
Figure 18
User configuration
3. The Brian Keller user is associated with the windows account VSALM\Brian, is designated a
Release Manager, and is an active member of a few different teams.
Figure 20
Viewing user configuration details
4. Navigate to Administration | Manage Groups to take a quick look at how groups can be setup.
Figure 21
Group configuration
5. Note that you can create new groups from scratch or you can import them from Active
Directory or Team Foundation Server. Groups that are imported from AD or TFS in this way are
linked by default, and will therefore remain synchronized.
Figure 22
Importing groups from AD and TFS
Note: Synchronization is manual (using the Refresh button) unless the setting AD/TFS-Based
Group Refresh Interval is setup to something other than 0 minutes (which is the default).
Figure 23
Viewing group details
7. The Members tab shows the individual users that are part of the QA Team. You can add more
users here if desired (since the group is not linked to AD or TFS).
Figure 24
Viewing group members
8. Select the Security tab.
Figure 25
Location of Security tab
9. The Security tab allows you to specify what Release Management permissions that the group
has. For the purposes of this virtual machine, the team members have full control.
Figure 26
Group security settings
10. Navigate to Administration | Manage Pick Lists and take note of the Stage Types defined here.
The stage type names defined here are completely arbitrary, and therefore can be molded to fit
your desired release strategy.
Figure 27
Configuring stage types
Task 3: Configuring Deployment Agents and Environments
1. Servers to be used for deployment must have the Microsoft Deployment Agent service installed
and configured to connect to the Release Management Server over HTTP or HTTPS. In addition,
these servers must be explicitly added to Release Management Server. Navigate to Configure
Paths | Servers and note that the deployment agent service has already been setup and
configured for this virtual machine.
Figure 28
Configuring servers
Note: Although we won’t do so here, the recommended way to add additional deployment
servers is to select the drop-down arrow next to the New button and then select Scan for
Agents.
Figure 29
Configuring servers
3. There are many options shown here for the selected deployment server, but the general
takeaway is that you want to configure servers that you add to be uniquely identifiable so that
Release Management Sever can target them. It is possible to used cloned servers, configure the
address type to be a gateway, and to have the server use HTTP(S) to grab the deployment bits
from the drop location (if it a UNC path is not an option).
Figure 30
Configuring servers
Figure 31
Viewing environment configuration
6. As the description states, this environment is meant to define the group of servers used for a
development environment. If you wanted to restrict the use of this environment to specific
stages, you could do so in the Stage Type Security tab.
Figure 32
Viewing environment configuration
Figure 33
Viewing release path
2. This release path defines a three-stage path through Dev -> QA -> Prod using the selected
environments. Most steps for the first two stages are automated, so the assigned user or group
does not intervene. Both the Dev and QA stages required approval before the next stage could
begin.
Figure 34
Viewing release path
3. Now let’s look at how the Fabrikam Fiber team defined the process used to deploy their web
application. Navigate to Configure Apps | Agent-based Release Templates and then double-
click on the Fabrikam Call Center template.
Figure 35
Configuring release template
4. The release template designer has a toolbox with control flow building blocks, servers, custom
components, and a bunch of other actions and tools to help with deployment. Select the
Properties link.
Figure 36
Viewing release template properties
5. Here you can see that the release template is set and a build definition is assigned. Also, note
the option to allow builds to trigger releases. Triggering a release from a build requires the use
of a modified build template and the installation of the Release Management Client on the build
server.
Figure 37
Viewing release template properties
Figure 38
Location of Collapse All button
8. The collapsed view shows just the VSALM server, which means that all deployment tasks will
occur on just this server. If you look at the Toolbox, you will notice that there is a Servers node.
This toolbox node shows all servers available to the environment configured for the currently
selected stage.
Figure 39
Deployment sequence showing server
9. Expand the VSALM node. In summary of the details to follow, the general deployment sequence
involves removing the existing web site from IIS, backing up the current bits, xcopy deploying
the new bits from the build, re-creating the web site in IIS, and finally rolling back if there are
failures.
Figure 40
Deployment sequence
10. Expand the Remove Web Site node. This action was dragged and dropped onto the deployment
sequence from the IIS toolbox node. It is configured to remove the “FabrikamDev” site from IIS.
Figure 41
Remove Web Site node
11. Expand the Copy File or Folder node. This action is from the Windows OS toolbox node and is
configured to back up the current web site location to a backup folder.
Figure 42
Copy File or Folder node
Figure 43
Call Center Site node
2. Let’s look at this component by navigating to Configure Apps | Components and then double-
clicking on the Fabrikam Call Center component.
Figure 44
Viewing custom component configuration
3. In the Source tab, note that the “Builds with application” option is selected. This means that
the component will inherit the team project and build definition from the release template. The
path to the package to deploy is currently set to [Build Drop Location]\_PublishedWebsites\
FabrikamFiber.Web.
Figure 45
Viewing custom component configuration
Figure 46
Viewing custom component configuration
Figure 47
Create Web Site node
2. Finally, look at the Rollback sequence, which restores the backup and re-creates the original
web site in IIS (if needed).
Figure 48
Rollback sequence
3. All stages of this demonstration release template have an identical structure, albeit with
different parameters.
Figure 49
Viewing QA stage
Note: In the likely event that your stages have a similar structure, you can copy and paste
elements from one stage to another. You can even copy the entire deployment sequence from
one stage to another. In the event that some servers are not available on the target stage, you
will be prompted to replace those servers with available ones. Copying an entire deployment
sequence can be accomplished by right-clicking on a stage node in the Release Template and
then selecting the option to copy.
2. The current set of configured tools provides the ability to execute command line statements,
manipulate files and processes, deploy databases and websites, install applications, manage
Azure virtual machines, and even run automated tests defined in Microsoft Test Manager. Some
of the tools are backed by scripts, while others are backed by executables. You can easily add in
your own tools if needed.
3. Select the Actions tab.
Figure 51
Location of Actions tab
4. Actions are specific applications of the tools. For example, a number of the defined actions
perform tasks in IIS using the IIS Deployer tool.
Figure 52
Viewing available actions
Note: You can also tag your servers per environment and use those tags as part of your
deployment sequence. This allows you to specify deployment actions for all servers in an
environment that are tagged. For example, the following screenshot shows the same
deployment as was highlighted earlier in the exercise, but with all servers being tagged with
“All” tag and select servers with a “Debug” tag. In the event that more servers are added to
the environment, the release template itself does not need to be modified.
Exercise 4: Release Automation Example
In this exercise, you will configure a Team Foundation Server build for continuous integration, ensure
that it automatically triggers a release, and then execute/follow that release all the way through the
development, QA, and production stages.
Figure 53
Team Explorer – Home view
Figure 54
Location of Builds tile
4. Right-click on the “Nightly Fabrikam (Dev)” build definition and select the Edit Build Definition
option.
Figure 55
Editing build definition
Figure 56
Location of Trigger tab
6. The name of the build implies that the Fabrikam Fiber application is built each night, even
though it is currently set to be manually triggered. Let’s say that the team has decided to go
with the Continuous Integration option, to build on each check-in, so select that option.
Figure 57
Selecting Continuous Integration option
Figure 58
Location of Process tab
8. As we pointed out in the previous exercise, a custom build process template needs to be used in
order for builds to be handed off to Release Management. Note that the
ReleaseTfvcTemplate.12.xaml template is selected.
Figure 59
Custom build process template
Note: The Release Management build process templates can be found in the
%ProgramFiles(x86)%\Microsoft Visual Studio 14.0\Release Management\bin folder.
9. As a quick aside, the custom build process template also contains the logic to tokenize your
configuration files. This logic assumes that in your solution, you have two versions of your
configuration files. One version is your normal configuration file used during local development,
and the other is a corresponding file that has the same content, except that instead of having
local values for your variables, tokens have been put there. The build activity will swap those
two files before doing the build, so that you end up with the tokenized version of the
configuration files in the drop location.
10. Here is an example of how to achieve this: Let’s say your solution contains a file called
web.config. You would need to copy that file (and keep them in sync), and name it
web.config.token. Your web.config file will stay the way it is now (and that will be used when
you run the app locally). The web.config.token file will contain tokens instead of values.
Figure 60
Example of token file
11. Back to our build configuration, scroll down to the Release Management section of the build
process parameters and note that the Release Build parameter is set to ‘True’. Both the build
definition and Release Management need to be configured in order to allow a build to trigger a
release.
Figure 61
Location of Release Build option
Note: In the case of a nightly build, it may make sense to set the Release Target Stage to be
something other than production, perhaps a development or QA stage, but for demonstration
purposes, we will take the release all the way to production.
12. Press Ctrl + S to save the build definition. Everything should now be in place for a continuous
integration scenario where a source check in will trigger both a build and a release.
Figure 62
Loading FabrikamFiber solution
2. Launch Internet Explorer from the taskbar and select the FF DEV button from the favorites bar
to load the Fabrikam Fiber site currently deployed to the development environment. You’ll have
to play along with the scenario here, as the QA and Production versions of the site are also on
the same machine, albeit on different ports.
Figure 63
Location of Fabrikam Fiber link (development)
3. To pick a simple but visual change to the site for demonstration purposes, let’s say that we need
to change “Fabrikam Fiber Support” to “Fabrikam Fiber Support v2.0”. Back in Visual Studio,
open _Layout.cshtml from FabrikamFiber.Web | Views | Shared.
Figure 64
Location of _Layout.cshtml
4. In _Layout.cshtml, locate the h2 tag that contains the “Support” text and change it to be
“Support v2.0”.
Figure 65
Modifying the web site
5. In Team Explorer – Pending Changes, select the Check In button. Select Yes if prompted to save
changes and check in.
Figure 66
Checking in change
Figure 67
Opening build in progress
2. Wait for the build to finish and then take a quick look at the log. If you scroll down through the
activity log, you should see the steps that have to do with Release Management.
Figure 68
Activity log showing steps involving Release Management
3. Launch the Release Management desktop client and navigate to Releases | Traffic Overview.
Figure 69
Loading Release Management traffic overview
4. Note that the Fabrikam Call Center release path now shows that another deployment is in
process in the development stage. Your numbers may be slightly different that the following
screenshot.
Figure 70
Traffic overview showing release in process
5. Double-click on the “Dev” stage for the Fabrikam Call Center release path.
Figure 71
Loading detailed traffic view for “Dev” stage
6. Assuming that you have waited long enough for the deployment to complete, you should see
that the most recent release (top) is currently in the “Dev” stage waiting for approval.
Figure 72
Release history showing release in progress
7. As a refresher, let’s take a look at the “Dev” stage workflow once again. No need to navigate
there in the application, just refer to the screenshot below.
Figure 73
“Dev” stage workflow configuration
8. As you can see, the acceptance, deployment, and validation steps are all automated while we
are awaiting explicit approval before moving on to the “QA” stage. Specifically, the release is
waiting for Brian Keller to provide approval. Although not configured in this virtual machine,
Brian would receive an email alerting him about the pending approval.
Task 4: Release Workflow and Approval Process
1. Select the My Approval Requests link to view pending approvals.
Figure 74
Location of My Approval Requests
Figure 75
Loading pending approval details
Figure 76
Location of View Sequence link
4. We can look at the deployment sequence and see all of the specific parameters that were (or
will be) used for each stage. Note that these ultimately become historical (and read-only) for
each specific release.
Figure 77
Deployment sequence showing parameters
Figure 78
Location of View Log link
6. The log shows the details and status for each step of the release process. This shows that the
deployment was automatically accepted, deployed, and validated for the “Dev” stage and is
now waiting for approval. The Deploy step also has additional details – select the ellipses
button in the details column.
Figure 79
Location of ellipses button
Note: You can view future steps as well by selecting the “Include Future Steps” option at the
bottom of the log.
7. The deployment log shows details for each action performed. Select the View Log link for the
Remove Web Site action. Use Notepad if prompted.
Figure 80
Viewing action log
Note: If a specific action fails, the output from the underlying tool used should provide
debugging information to help determine if there is a problem with the target environment or
the deployment sequence.
8. This log shows that the FabrikamDev web site was deleted successfully.
Figure 81
Viewing successful action log
9. Close the Notepad window and the Deployment Log window.
10. Before we approve the release, let’s look at the deployed site in Internet Explorer. Select the
“FF DEV” link from the favorites bar.
Figure 82
Location of “FF DEV” link
Figure 83
Deployment to the development environment is a success
12. In Release Management, return to My Approval Requests, select the release, and then select
the Approve button.
Figure 84
Approving the release to the development stage
13. In the Approval Confirmation window, enter a comment such as “Dev deployment looks good”
and then select the OK button.
Figure 85
Adding an approval confirmation comment
14. The deployment will then transition to the “QA” stage and automatically deploy the web site to
the configured environment. Refresh the My Approval Requests view until the release stops for
QA approval.
Figure 86
Waiting for QA approval
15. Once the deployment is complete and automatically validated, someone from the QA Team will
need to approve the release. Brian is a member of the team, so go ahead and load the QA site
using the “FF QA” favorite link in Internet Explorer.
Figure 87
Deployment to the QA environment is a success
16. Back in Release Management, navigate to the My Approval Requests view, select the
deployment, and then select the Approve button.
Figure 88
Approving the release to the QA stage
17. In the Approval Confirmation window, enter a comment such as “QA deployment looks good”
and then select the OK button.
Figure 89
Adding an approval confirmation comment
18. As a refresher, let’s take a look at the “Prod” stage workflow once again. No need to navigate
there in the application, just refer to the screenshot below. Note that the acceptance step is not
automated as it was for the previous stages. This means that the assigned approver must
explicitly sign off on before the actual deployment to production will begin.
Figure 90
“Prod” stage workflow configuration
19. Select the pending approval request in My Approval Requests and note that Brian has a few
options to consider besides approval - including reassignment and rejection. Let’s go ahead and
approve the deployment to production since the QA Team signed off on the previous stage.
Select the Approve button.
Figure 91
Approve the request to deploy to production
20. In the Approval Confirmation window, enter a comment such as “Ready for production”. Note
that you can deploy immediately or schedule the deployment for later. Use the default option
to deploy now and then select the OK button.
Figure 92
Approve the request now
21. Go ahead and load the production site using the “FF PROD” favorite in Internet Explorer. You
may need to refresh the page a few times before the build is fully deployed (displaying “Support
v2.0”).
Figure 93
Deployment to the production environment is a success
22. The Ops Team now needs to validate the deployment. Select the request and then select the
Approve button.
Figure 94
Approving the deployment to production
23. In the Successful Deployment Confirmation window, enter a comment such as “Ops approved”
and then select the OK button. The operations team may have their own suite of tests that they
run to ensure that everything is running as expected and ready for end-users.
Figure 95
Approve the deployment to production
24. Navigate to Releases | Releases and note that the release has made it to the target stage of
“Prod” and has a Status of “Released”.
Figure 96
Build has been released to production
3. Name the release “QA Testing”, select the Fabrikam Call Center release template, select a
target stage of QA (we don’t want to go all the way to production), and then select the
“Select…” link next to the Build field.
Figure 98
Manually triggering a release
Figure 99
Selecting a build
6. (Optional) If you were to follow this release to the target stage using the same process as
before, you would end up with the desired build deployed to the QA environment.
7. To learn more about Release Management, please visit
http://www.visualstudio.com/explore/release-management-vs.
In this exercise, you will walk through the process of connecting Release Management to a Windows
Azure subscription, defining a release template that deploys Fabrikam Fiber to an Azure virtual machine
using DSC, and finally triggering a release to Azure.
Task 1: Setting up Azure Resources
1. One bit of housekeeping before we move on. If you are continuing from the previous exercise,
change the Trigger for the “Nightly Fabrikam (Dev)” build definition back to Manual (we
previously changed it to Continuous Integration).
2. In order to configure Release Management to work with your Azure subscription, you will first
need to download the publish profile. This is easy to do using Windows Azure PowerShell (pre-
installed on the virtual machine for your convenience). Search for and launch Microsoft Azure
PowerShell from the Start screen.
Figure 101
Launching Microsoft Azure PowerShell
3. Type “Get-AzurePublishSettingsFile” into the Microsoft Azure PowerShell window and then
press Enter.
4. Enter your credentials, select the subscription file that you wish to download (if you have more
than one subscription), and finally select the Submit button to download the publish settings
file.
Figure 102
Downloading publish settings for selected subscription
Note: Please be aware that the publish settings file contains sensitive information such as an
encoded management certificate.
10. Create a new SQL database in the same region used to house your virtual machine (click the
New button, Data Services, SQL Database, Custom Create) with the following options:
◦ Name: <your choice>
◦ Service Tier: Basic
◦ Server: <select existing, or create new if necessary>
Note: In the event that you need to create a new server, provide your desired login name and
credentials, but select the same region as you have been using in previous steps.
11. Please wait for the virtual machine, storage account, and SQL database are in the
Running/Online state before moving on. This will take a few minutes.
Figure 103
Creating connection to Azure subscription
Figure 104
Creating connection to Azure subscription
8. Now we can link to the Azure subscription in order to pull in the virtual machine that we
created earlier. Select the Configure Paths | Environments tab and then select the New vNext:
Azure option from the drop-down.
Figure 105
Creating a new Azure environment
Figure 106
Linking Azure Environment
10. In the Azure Environments window, select the subscription that you created earlier.
Figure 107
Selecting subscription containing desired environment
11. Select the Azure environment that you created earlier (this is the DNS name of the cloud
service) and then select the Link button.
Figure 108
Selecting desired environment
Figure 109
Linking Azure Servers
14. In the Azure Servers window, select the Azure virtual machine that you created earlier and then
select the Link button. Note that applying some sort of naming scheme here makes it more
evident that the Azure service and virtual machine are meant for production deployments of a
web site.
Figure 110
Linking to specific servers in Azure
15. Select the Save & Close button for the new environment.
Figure 111
Saving the new environment for use with Release Management
Figure 113
Creating a name for release path
Figure 114
Defining a stage for release path
4. For demonstration purposes and simplicity, let’s just define a single production stage using the
new environment running in Azure. For the Stage drop-down, select the “Prod” option. For
Environment, select the environment that you just linked.
Figure 115
Defining a new stage
5. For demonstration purposes and simplicity, automate all steps and select the Ops Team for
each step.
Figure 116
Defining a new stage
6. Select Save & Close to save and close the new release path definition.
Figure 117
Creating a new component
2. For the Name, use something like “Fabrikam Call Center - Cloud”.
3. In the Source tab, use the default option that states “Builds with application” and specify the
path to package to be “[Build Drop Location]\_PublishedWebsites\FabrikamFiber.Web”. Select
the Save & Close button.
Figure 118
Defining a component for the sample website
Figure 119
Opening DSC script in Visual Studio
4. This DSC script defines the necessary configuration for the Fabrikam Fiber website in a
declarative manner. If you scroll down and glance at the configuration sections, you should be
able to determine what is happening here at a high level. The IIS role is installed (if needed), the
ASP.NET 4.5 role is installed (if needed), the website bits are copied to the server, the default
website is stopped, and the Fabrikam Fiber site is created and started. At the very end, the
configuration is enacted using the specified configuration data.
Figure 120
DSC script
Note: DSC is a PowerShell extension that ships with Windows Server 2012 R2 and Windows
8.1, although you can bring support for DSC down to Windows Server 2008 R2 and Windows 7
by installing the Windows Management Framework 4.0.
5. Most of the configuration modules used here are built into DSC. However, you can use or create
custom modules to tackle other needed tasks. Note that a module named xWebAdministration
is imported at the beginning of the configuration.
Note: The xWebAdministration module contains a number of resources that can be used for
configuring IIS, including xWebsite that is used in this script. You can acquire a number of
different modules for use in DSC scripts from the PowerShell Resource Gallery (currently in
preview form at https://msconfiggallery.cloudapp.net).
6. Note that the xWebAdministration module is included in source control within the Deploy
folder. This folder is deployed with the website, and is therefore available to script that runs on
the target servers during deployment.
Figure 121
xWebAdministration folder deployed with website
7. Now let’s take a quick peek at the configuration script by opening FFDeployConfig.ps1. Note
that although we are looking at this script first, it is actually the first one to run on the server.
Figure 122
Insert Caption
8. The first part of this script places the xWebAdministration module in a discoverable location on
the server. Next, a firewall rule is created to allow traffic in via port 80 if needed. The most
important part to point out is the definition of $ConfigData (which is referenced when the
configuration is enacted).
Figure 123
DSC configuration script
Figure 124
Opening web.config
2. In the Azure management portal, navigate to the dashboard for the database that you created
earlier and then click on the “View SQL Database connection strings…” link.
Figure 125
Viewing the connection string for the database
3. Select the connection string shown for ADO.NET and then press Ctrl+C to copy it.
Figure 126
Copying connection string for database
8. Switch back to Visual Studio and then paste (Ctrl+V) the connection string at the appropriate
place for the connection string named “FabrikamFiber-Express”.
Figure 127
Location to place new connection string
9. Locate the part of the connection string with the {your_password_here} placeholder and
replace it with the real value.
10. Open Global.asax and comment out the call to Database.SetInitializer in Application_Start().
17. Select the Save to Clipboard option and then click Next.
18. Click Next.
19. After the result is a Success, click Finish.
20. In Object Explorer, click the Connect dropdown and then select Database Engine.
21. For Server Name, enter the fully qualified name of your server running in Azure.
22. For Authentication, choose SQL Server Authentication and then enter your credentials. Refer
to the connection string that you just modified in web.config if necessary.
23. Click Connect.
24. Expand the Databases node to locate your database.
25. Right-click on the database node and select New Query.
26. Press Ctrl+V to paste the clipboard data into the new query.
27. Delete the first line of the SQL script that is “USE [FabrikamFiber-Express]”.
28. Click the Execute button to run the script.
31. In the Process tab, change the Release Build option to False (see the Release section at the
bottom). We will manually create a new release later.
Figure 129
Modifying build definition
Figure 130
Creating a new release template
7. Select the component that you created earlier and then select the Link button.
Figure 133
Linking component to release template
8. Drag and drop an instance of the Deploy Using PS/DSC action to the Deployment Sequence.
Figure 134
Adding deployment action to deployment sequence
9. Expand the Deploy Using PS/DSC action within the Deployment Sequence.
Figure 135
Adding deployment action
10. Now it is time to fill in the configuration variables for the Deploy To Azure Environment action.
11. Type the configuration variables as shown in the screenshot below, just make sure that your
ServerName, UserName, Password, and ComponentName match the correct values for your
setup (you can find ServerName and ComponentName specified in the Toolbox).
Figure 136
Providing configuration variables
Figure 137
Saving the new release template
Figure 138
Creating a new release
2. In the Properties window, select the most recent build by clicking on the Select link.
Figure 139
Selecting the build to release
3. Double-click on the most recent build to select it. You may need to set the filter to be “< Any
Time>”.
Figure 140
Selecting the build to release
5. You can monitor the progress of the release in the Release Management client. Note that it will
take a few minutes for the first release to be deployed to your Azure virtual machine, as the DSC
script will install IIS, ASP.NET 4.5, and so on if they haven’t been already (which will be the case
on a default installation of Windows Sever).
Figure 142
Release in progress
6. After the release has completed, select the View Log link. Open the log using Notepad.
Figure 143
Viewing deployment log
7. Scroll down through the log file to the section where the DSC configuration output is shown.
You should see that IIS was installed, ASP.NET, and so on. Close the Notepad window.
8. Test out the release of Fabrikam Fiber to Azure by loading the URL for your Azure service in
Internet Explorer. This should be the name of your environment with cloudapp.net appended. If
you don’t remember the name of the service that was created for your virtual machine in Azure,
return to the management portal and navigate to the Cloud Services tab -- there should be a
column that contains a URL link you can click on. After a few moments, you should see the
deployed Fabrikam Fiber site.
Figure 144
Fabrikam Fiber running in Azure