Dışarıya aktar (0) Yazdır
Tümünü Genişlet
Bu içerik dilinizde bulunmamaktadır ancak İngilizce sürümüne buradan bakabilirsiniz.

Change the Configuration of a Running Cloud Service

Updated: October 24, 2014

You might need to test the scalability of your cloud service by adding more running instances of a role. You do not need to stop a running service to add new role instances. To do this, you modify the configuration file (ServiceConfiguration.cscfg) for the cloud service, and then you update the running service by using the CSRun Command-Line Tool.

The following example shows the contents of a configuration file that defines the configuration for two worker roles that start with one running instance each:

<?xml version="1.0"?>
<ServiceConfiguration serviceName="TestService" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration">
  <Role name="WorkerRole1">
    <Instances count="1" />
      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />
  <Role name="WorkerRole2">
    <Instances count="1" />
      <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="UseDevelopmentStorage=true" />

  1. Open the .cscfg file for your service (by default the name is ServiceConfiguration.cscfg) either by using Visual Studio or your preferred text editor.

  2. Change the count value of the Instance element for a role to the desired amount. Change the value of the count attribute of the Instances element. The following example shows the configuration of two instances:

    <Instances count="2" />

    Make this change for each role that you want to increase running instances.

  3. Save the configuration file.

  4. Click Start, point to All Programs, and then click Windows Azure SDK.

  5. Right-click Windows Azure SDK Command Prompt, and then click Run as administrator.

  6. In the Azure SDK Command Prompt window, change the directory to where your hosted service files are located.

  7. Type the following command in the command-prompt window:

    csrun /update:<DeploymentID>;<ServiceName>\ServiceConfiguration.cscfg

    Where <DeploymentID> is the identifier of the running deployment of your cloud service. You can find this identifier by locating the deployment node in the user interface of the Microsoft Azure compute emulator. <ServiceName> is the name of your cloud service.

  8. The new role instances are suspended when created. To run the instances, click the deployment node, and then click the green arrow that runs role instances.

See Also

© 2015 Microsoft