0 out of 1 rated this helpful - Rate this topic

Provisioning Windows Azure For a Load Test

When using Visual Studio Ultimate to do a load test in Azure, you must provision the Azure with the following components:

  1. Hosted Service

  2. Storage Account

  3. Connect Group

In addition, you must create three .zip files that are uploaded to the Azure portal. The .zip files contain the controller and agent code, as well as the setup files for SQL Server 2008 R2 Express.

The sections below walk through the steps of provisioning the Azure Management portal.

For an overview about running visual Studio load test in Azure, see Using Visual Studio Load Tests in Windows Azure Roles

Creating a Hosted Service

For this application, you must create a hosted service, however you should not deploy it.

To create a hosted service

  1. Log in to the Windows Azure Management portal.

  2. In the left pane, click Hosted Services, Storage Accounts & CDN.

  3. In the left pane, click the Hosted Services node.

  4. In the ribbon, click New Hosted Service.

  5. Select the subscription where the service will be created.

  6. Type the name of the service. For this tutorial, type "Azure LoadTest"

  7. Type a URL prefix for the service. The URL must be unique; if is not, this message will appear: The requested name has already been claimed and is no longer available.

  8. Choose a region or affinity group for the service.

  9. Under Deployment options select the Do not deploy option.

Creating a Storage Account

A storage account for containing public blobs must be created.

To create the storage account

  1. In the left pane, click Storage Accounts.

  2. Right-click the subscription name that hosts the service, then click New Storage Account.

  3. In the dialog box, type a unique URL. Note that the URL must be in all lower-case letters, and can contain only letters and numbers.

  4. Choose a region or affinity group for the storage. It should be the same region or affinity group as the hosted service.

  5. Click OK.

  6. After the account is created, refresh the browser to see the Properties of the account.

  7. From the Properties pane, copy the Name value, and save it for later use. The value is also referred to as the storage account name.

  8. Under Primary access key click the View button.

  9. In the dialog box, click the "copy" icon (to the right of the access key value). Save the value for later use. The value is also called the account key.

Configuring the Application with the Storage Account Name and Key

With a storage account created, you can configure the application.

To configure the Load Test application

  1. Run Visual Studio as an Administrator.

  2. Open the AzureLoadTest solution. (See Windows Azure Load Test Prerequisites and Setup.)

  3. In Solution Explorer, expand the AzureLoadTest project, then expand the Roles folder.

  4. Right-click the Agent role and click Properties.

  5. In the Agent [Role] page, click the Settings tab.

  6. Select the Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString setting.

  7. In the Type column, set the drop-down value to Connection String.

  8. At the right of the Value column, click the ellipsis (…) button.

  9. In the Storage Account Connection String dialog box select the Enter storage account credentials option.

  10. Paste in the account name into the Account name box.

  11. Paste the primary access key value into the Account key box.

  12. Click the OK button.

  13. In Solution Explorer, in the Roles folder, right-click the Controller role and click Properties.

  14. In the Controller [Role] page, click Settings.

  15. Repeat steps 6 to 12.

Configuring the Application with the Load Test Key

The Visual Studio load test feature requires that you supply a valid key in order to work. The key can be obtained from your MSDN subscription, which is free with a copy of Visual Studio Ultimate. Once you have the key, configure the application with it. For more information about the load test key, see:

To obtain the load test key

  1. Sign in to your MSDN subscription. Go to: MSDN Subscriptions and click the Sign In link.

  2. Once signed in, go to the Secure Downloads page.

  3. Find the Visual Studio 2010 Load Test Feature Pack entry. In the Keys column, click the View link.

  4. Find the value in the Product Keys column.

To configure the application with the load test key

  1. In Solution Explorer, open the Properties page of the Controller role.

  2. In the Properties page, click the Settings tab.

  3. Paste the product key into the TestController_License setting.

Creating Controller, Agent, and SQL Express .Zip Files

The load test relies on two sets of code that run on the two worker roles. The controller and agent code are downloaded from the Microsoft Download Center and must be repackaged as .zip files. The .zip files must then be uploaded to the Azure storage account. When the application is deployed, the OnStart method of the RoleEntryPoint class is called. Within the method, installation code is then invoked, and the controller and agents are run as services on the worker roles.

To create the controller agent .zip files

  1. Download the X16-49583VS2010Agents1.iso file from the Download Center: Visual Studio Agents 2010 – ISO.

    The file contains both the controller and agent software.

  2. Find and download .zip utility on the Internet by searching for "free .zip utilities" or similar.

  3. Run the utility and open the X16-49583VS2010Agents1.iso file.

  4. Extract the testagent and testcontroller folders.

  5. Using the utility, create two new .zip files with the contents of the extracted folders. The new .zip files are named as follows:

    • testagent.zip

    • testcontroller.zip

    ImportantImportant
    The contents of the folders must be at the top level of the .zip file. By default, simply repackaging the folders will put the contents in a folder in the .zip file, which is one level too deep. The contents must be accessible at the first level for the installation code to extract the code.

A third .zip file must be created. The SQL Express engine must also be installed on the controller worker role. In order to do this, you must first retrieve the (free) SQL Server Express installation package, the repackage it as a .zip file.

To create the SQL Server Express installation file

  1. Download the SQL Server 2008 R2 Express database and management setup:SQL Server 2008 RS Express and Management Tools

  2. Run the .zip utility and open the SQLEXPRWT_x64_ENU.exe. (Despite the .exe extension, the file is also an .iso archive file.

  3. Extract the contents.

  4. Use the .zip utility and create a new file named SQLEXPRWT_x64_ENU.zip.

    ImportantImportant
    As with the controller and agent .zip files, the contents of the installation package must be at the top level of the new .zip file.

Uploading the .Zip Files to the Azure Storage Account.

The .zip files must be available to the worker role as it starts up and runs the installation procedures. To do that, you must create a single public blob container, and upload the files there. While you can use code to upload the files, this procedure uses a downloadable tool.

ImportantImportant
The storage container must be public.

To upload the .zip files

  1. Download the tool here: Storage Service Smart Client

  2. Open the StorageServicesSmartClient solution in Visual Studio.

  3. Configure the application with your storage account name and key.

    1. In Solution Explorer, open the App.config file.

    2. Find the <storageAccounts> element.

    3. Under the <storageAccounts> element, select one of the <add> elements. Refer to the following example. In the key attribute, replace "<MyStorageName>" with your Azure storage account name. In the value attribute, replace "<MyStorageName>" with your storage name. Also in the value attribute replace "<MyPrimaryAccessKey>" with your storage account key.

      <add key="<MyStorageName>" value="DefaultEndpointsProtocol=https;AccountName=<MyStorageName>;AccountKey=<MyPrimaryAccessKey>"/>
      
      
  4. Run the application.

  5. In the lower left corner, under Storage Accounts, click the drop-down box and select your storage name.

  6. Under Container Commands click the New button. Leave the default set to Public.

  7. Give the new container a name and click OK.

  8. In the left pane, under Blob Services, select the new container.

  9. In the section named Blob Commands click the New button.

  10. In the Upload Files dialog box, click Select.

  11. Navigate to the directory where the controller, agent, and SQL Express setup .zip files are saved to upload them.

  12. Record the name of the new container for later reference. It is used when configuring the application.

Configuring the Application for the .Zip Files

Having created the .zip files and uploaded them to the Azure storage account, you must now configure the Load Test application with the proper values.

To configure the application for the .zip files

  1. In Visual Studio, open the AzureLoadTest solution.

  2. In Solution Explorer, expand the AzureLoadTest project, then expand the Roles folder.

  3. Right-click the Agent role and click Properties.

  4. In the Agent [Role] page, click the Settings tab.

  5. Select the TestAgent_Zip setting.

  6. In the Value box, replace the values for the storage address as shown. Refer to the following example. In the URL, replace "<MyStorageName>" with your Azure storage account name. Then replace "<mycontainername>" with your blob container name.

    http://<MyStorageName>.blob.core.windows.net/<mycontainername>/testagent.zip
    
  7. In Solution Explorer, right-click the Controller role and click Properties.

  8. In the Settings tab, select the SqlExpress_Zip setting.

  9. In the Value box, replace the values for the storage address as shown. Refer to the following example. In the URL, replace "<MyStorageName>" with your Azure storage account name. Then replace "<mycontainername>" with your blob container name.

    http://<MyStorageName>.blob.core.windows.net/<mycontainername>/SQLEXPRWT_x64_ENU.zip
    
  10. Select the TestController_Zip setting. Replace the

  11. In the Value box, replace the values for the storage address as shown. Refer to the following example. In the URL, replace "<MyStorageName>" with your Azure storage account name. Then replace "<mycontainername>" with your blob container name.

    http://<MyStorageName>.blob.core.windows.net/<mycontainername>/testcontroller.zip
    

Creating a Connect Group

The Connect feature of Azure allows you to create a Virtual Private Network. Members of the group can include on-premise computers as well as Azure role instances. For the Load Test solution, the Connect group allows communication between the test controller and the agents. For more details about setting up a Connect group, see http://msdn.microsoft.com/en-us/library/gg508836.aspx

If you have not created a Connect group before, install a local endpoint onto the development computer (the computer used to develop and manage the controller instance).

ImportantImportant
The local endpoint can be installed only once on any computer, and it works only with Connect groups created in a specific Azure subscription. If you have already installed a local endpoint for a particular Azure subscription, you must uninstall it before installing a new local endpoint for a different subscription. For more information, see How to Install Local Endpoints with Windows Azure Connect.

To install a local endpoint

  1. In the Azure Management portal, click Virtual Network in the left pane.

  2. Select the subscription where the application will be hosted.

  3. In the ribbon, click Install Local Endpoint.

  4. In the Install Windows Azure Connect Endpoint Software dialog box, click Copy Link to Clipboard and click OK.

  5. Paste the link into the Internet Explorer address box and press Enter.

  6. Follow the instructions to install the endpoint.

To create the Connect group

  1. In the Azure Management portal, ensure that you have clicked Virtual Network in the left pane.

  2. Select the subscription in which the application will be hosted.

  3. Expand the node where the service is hosted.

  4. Select the Groups and Roles node.

  5. In the ribbon, click Create Group.

  6. In the dialog box, type a name for the group.

  7. Click the Create button.

  8. In the Windows tray, click the Connect Endpoint tray icon and click Refresh Policy.

  9. To add the local endpoint to the group:

    1. In the Azure Management portal, select the newly created group.

    2. In the ribbon, click Edit Group.

    3. In the Edit Endpoint Group dialog box, in the Connect from section, click the Add button

    4. In the Select Local Endpoints dialog box select the computer and click OK.

      If the computer does not appear, see Troubleshooting Windows Azure Connect

    5. Click the Save button.

At this point, you cannot add the worker role endpoints to the group. Instead, the roles are added when you configure the worker roles with the activation token, as shown below in "Configuring the Application for the Connect Group" below. Additionally, the roles only appear in the Connect group after the application is deployed, and the roles are created.

Configuring the Application for the Connect Group

To configure the application for use in the Connect group

  1. In the Windows Azure Management portal, click Virtual Network to open the Connect user interface.

  2. Select the subscription that hosts the Load Test application Connect group.

  3. In the ribbon, click Get Activation Token.

  4. Click the Copy Token to Clipboard button and click OK.

  5. In Visual Studio, open the AzureLoadTest solution.

  6. In Solution Explorer, expand the AzureLoadTest project, then expand the Roles folder.

  7. Right-click the Agent role and click Properties.

  8. In the Agent [Role] page, click the Virtual Network tab.

  9. Select the Activate Windows Azure Connect setting.

  10. Paste the activation token value into the box.

  11. In Solution Explorer, right-click the Agent role, and click Properties.

  12. Repeat steps 8 to 10.

Next Steps

The steps here have configured both the Azure Management portal and the Load Test application with the necessary files and values to get to the next stage of development. To continue, go to Publishing the Load Test To Windows Azure.


Build Date:

2013-04-18
Did you find this helpful?
(1500 characters remaining)

Community Additions

ADD
© 2013 Microsoft. All rights reserved.