Setup
Windows Azure Training Kit – Setup Instructions
Lab version: 1.0.0
Last updated: 12/11/2011
Setup Instructions
The Training Kit includes a dependency checker tool that you use to scan your environment for prerequisites needed to run each lab. In addition to verifying dependencies, the tool also performs any setup tasks that are needed to prepare a lab for execution, such as installing its Visual Studio code snippets, creating certificates, building tools used during the lab from their source code, among many others. These requirements vary for each lab. The tool uses a dependency script file (.dep file) to determine both the list of requirements and the setup tasks specific to each lab.
Note: The following setup procedure requires administrative privileges. Depending on your security settings, you may need to confirm your actions when prompted by the User Account Control dialog to allow the setup process to continue.
Preparing your Computer to Use the Training Kit
To prepare your computer to use the Training Kit, you must first install the Dependency Checker tool by performing the following steps:
1. Browse to the Hands-on Labs or Demos page of the Training Kit.
2. Locate the hands-on lab or demo that you wish to set up and then click its Setup Lab (or Setup Demo) link. If, following a security prompt from your browser, the Dependency Checker Wizard appears, your computer is already prepared to use the Training Kit and you may skip the remainder of this section. Please refer to the section titled Preparing your Computer to Run a Hands-On Lab in this document for instructions on how to set up individual labs.
Figure 1
Launching the setup for a hands-on lab
3. If this is the first time you launch a dependency checker script, you will be prompted by a warning message informing that you need to install the Dependency Checker tool. Click OK to download its MSI installer.
Figure 2
Missing Dependency Checker tool warning
4. In the File Download dialog, click Run when prompted to run or save the file. This downloads the MSI file and launches the Dependency Checker Setup Wizard.
Figure 3
Dependency Checker Installer
5. Follow the steps in the installation wizard to setup the Dependency Checker. If the User Account Control dialog appears, confirm it to proceed.
Figure 4
Dependency Checker Setup Wizard
6. Wait for installation to complete and then refresh the Labs page in your browser window.
Figure 5
Successful installation of the Dependency Checker tool
7. Once you successfully install the Dependency Checker tool in your system, you may click the Setup Lab link for any of the labs or demos in the Training Kit to launch the tool and run its setup scripts.
Preparing your Computer to Run a Hands-On Lab
To prepare your computer to run a hands-on lab, you must perform the following steps:
1. Locate the hands-on lab or demo that you wish to set up and then click its Setup Lab link.
Figure 6
Launching the Dependency Checker tool for a hands-on lab
Note: Remember to refresh the page after you install the Dependency Checker. Otherwise, you will be prompted to install the tool again.
2. If your browser requests confirmation to open a program on your computer, click Allow to proceed.
Figure 7
Allowing the Dependency Checker to run
3. In the Welcome step of the wizard, click Next to proceed.
Figure 8
Dependency Checker configuration wizard
4. In the Detecting Required Software step of the wizard, verify that every item on the dependency list is detected. For missing prerequisites, click the Download link to access its download location, or the Install link, when available, to install the missing prerequisite. After installing a missing prerequisite, click Rescan to initiate the detection process again. Once the detection process is complete and you have verified every prerequisite, click Next to proceed.
Figure 9
Detecting required software
5. After the dependency check, the setup process installs the Visual Studio code snippets. For more information, see the section Installing the Code Snippets in this document.
6. Depending on the lab, the setup process may perform additional tasks.
7. Once it has completed, click Close to exit the Configuration Wizard.
Note: Alternatively, you may launch the Dependency Checker for a hands-on lab from the Windows Shell instead of the browser. To do this, browse to Setup in the Source folder of the lab and double-click the Dependencies.dep file.
Installing the Code Snippets
For convenience, much of the code that you need to type while executing a lab is available as Visual Studio code snippets. During setup, and after it checks the lab prerequisites, the Dependency Checker installs the code snippets.
Note: The figures illustrating this section correspond to one of the labs in this Training Kit and will differ for each lab.
The code snippets installation can also be run manually without using the Dependency Checker. Generally, you will find the code snippets .vsi installer in either one of the following lab's folder: Source\Setup or Source\Setup\Scripts\snippets.
Note: If you experience issues running the code snippets installer, you can install the code snippets manually by copying all the .snippet files contained inside the .vsi to the following location:
- \My Documents\Visual Studio 2010\Code Snippets\Visual C#\My Code Snippets (for C# snippets)
- \My Documents\Visual Studio 2010\Code Snippets\Visual Basic\My Code Snippets (for VB snippets)
Check the “Manually Installing the Code Snippets” at the end of this document for detailed instructions on how to do this.
The following are the steps to set up the Visual Studio snippets.
1. When prompted, choose all items in the installer.
Figure 10
Code snippets for exercise
2. A dialog window appears warning that the file is not signed; choose Yes to proceed anyway.
Figure 11
Warning dialog window
3. When prompted for the location of the VB code snippets, highlight all the snippets, click the check box next to My Code Snippets, and then click Next.
Figure 12
Selecting the location to install the Visual Basic code snippets
4. When prompted for the location of the C# code snippets, highlight all the snippets, click the check box next to My Code Snippets, and then click Next.
Figure 13
Selecting the location to install the C# code snippets
5. Click Next to continue.
Figure 14
Confirming the installation of the code snippets
6. Click Finish.
7. The installation should proceed and install all the snippets.
Figure 15
Successful installation of the code snippets
Manually Installing the Code Snippets
Under certain circumstances, the .vsi installers for code snippets might fail to run. When that happens, there is a manual alternative to install the code snippets within Visual Studio. Follow the instructions below to do so:
1. Rename (change the extension) of the .vsi installer to .zip
Note: Generally, you will find the code snippets .vsi installer in either one of the following lab's folder: Source\Setup or Source\Setup\Scripts\snippets.
Figure 16
Renaming vsi installer to .zip
2. Extract the content of the zip file to any temporal location. You should see the code snippets files after extracting (.snippet extension)
Figure 17
Expanded snippet files
3. Copy the snippet files to the following location (according to the code language):
◦ For C#: \My Documents\Visual Studio 2010\Code Snippets\Visual C#\My Code Snippets
◦ For VB: \My Documents\Visual Studio 2010\Code Snippets\Visual Basic\My Code Snippets
Using the Code Snippets
With code snippets, you have all the code you need at your fingertips. The lab document will tell you exactly when you can use them, as shown in the following figure.
Figure 18
Using Visual Studio code snippets to insert code into your project
To add a code snippet using the keyboard (C# only)
1. Place the cursor where you would like to insert the code.
2. Start typing the snippet name (without spaces or hyphens).
3. Watch as IntelliSense displays matching snippets' names.
4. Select the correct snippet (or keep typing until the entire snippet's name is selected).
5. Press the Tab key twice to insert the snippet at the cursor location.
Figure 19
Start typing the snippet name
Figure 20
Press Tab to select the highlighted snippet
Figure 21
Press Tab again and the snippet will expand
To add a code snippet using the mouse (C#, Visual Basic and XML)
1. Right-click where you want to insert the code snippet.
2. Select Insert Snippet followed by My Code Snippets.
3. Pick the relevant snippet from the list, by clicking on it.
Figure 22
Right-click where you want to insert the code snippet and select Insert Snippet
Figure 23
Pick the relevant snippet from the list, by clicking on it