共用方式為


Entering Configuration Information

Retired Content

This content and the technology described is outdated and is no longer being maintained. For more information, see Transient Fault Handling.

patterns & practices Developer Center

On this page:
Installing the Enterprise Library Configuration Console | Opening the Autoscaling Application Block Configuration in the Enterprise Library Configuration Tool | Configuring Autoscaling Settings | Configuring the Rules Store | Configuring the Service Information Store | Configuring the Service Management Request Tracker | Configuring the Execution Lease | Configuring the Logger

The Autoscaling Application Block stores its configuration data in the main configuration file of the host worker role or on-premises application. To edit the configuration file, you can either use the Enterprise Library Configuration Tool or edit the configuration file using a text editor. The configuration includes the following information:

  • Autoscaling Settings. These settings include information about where the block stores the data point values that it uses in rules evaluation, and how often it evaluates the autoscaling rules.
  • Rules Store Settings. These settings include information about where the block stores its autoscaling rules, and any custom extensions provided by the user.
  • Service Information Store Settings. These settings include information about where the block stores its service information model.
  • Advanced Settings. These settings control advanced features such as request tracking and blob execution leases.
  • Logger Settings. These settings specify the logging infrastructure that the block should use.

Note

Typically, if you host the Autoscaling Application Block in a worker role, you will store the data points, rule definitions, and service information in Microsoft Azure storage. You should try to use a storage account in the same data center to avoid data transfer charges. You should also try to use a separate storage account from any storage accounts that your Azure application uses; this will make it easy to manage your Azure storage requirements.

The following procedures explain how to configure these settings for the Autoscaling Application Block.

For details of the schema for the Autoscaling Application Block configuration, see Source Schema for the Autoscaling Application Block. You can also configure the block in code by using an alternate configuration source. For more information, see Advanced Configuration Scenarios in the Enterprise Library 5.0 reference documentation.

These procedures assume you have added the Autoscaling Application Block to your Visual Studio project from the NuGet repository, as described in the topic "Adding the Autoscaling Application Block to a Host."

Installing the Enterprise Library Configuration Console

To install the Enterprise Library Configuration Console if it is not already installed in Visual Studio:

  1. In Visual Studio, on the Tools menu, click Extension Manager.
  2. In the Extension Manager dialog, click Online Gallery, and then in the Search Online Gallery box, type Enterprise Library Config.
  3. Make sure that you can see version 5.0.505 of the EnterpriseLibrary.Config package. Then click the Download button.
  4. Read the license and then click Install.
  5. Click the Restart Now button to restart Visual Studio and complete the installation.

Opening the Autoscaling Application Block Configuration in the Enterprise Library Configuration Tool

To open the Autoscaling Application Block configuration in the Enterprise Library Configuration tool

  1. Right-click on the app.config file in the project that will be hosting the block and click Edit configuration file.
  2. In the Enterprise Library Configuration tool, open the Blocks menu, and then click Add Autoscaling Settings.
  3. The Enterprise Library Configuration tool automatically adds the Autoscaling Settings section with default settings.

Note

The Enterprise Library configuration tool allows you to add configuration settings for other Enterprise Library application blocks. Some of these blocks are not appropriate for use with Azure. For more information, see the document "Using Enterprise Library 5.0 in Microsoft Azure."

Configuring Autoscaling Settings

To configure the autoscaling settings

  1. Click the properties expander arrow in the Autoscaling Settings section to open the list of properties.

    Hh680915.4A0F86C53347F714EAD9E24573A86D24(en-us,PandP.50).png

  2. (Optional) If you want to encrypt the configuration, make a selection from the Protection Provider drop-down list. You cannot use the RsaProtectedConfigurationProvider or the DataProtectedConfigurationProvider providers to encrypt the configuration in Azure. To encrypt the settings in Azure you must use a custom provider. For more information, see the topic "Encrypting the Autoscaling Settings in the Configuration File."

  3. (Optional) If you want to run your application in partial trust mode, change the Require Permission property to False. The default is True.

    Note

    If the block is hosted in an Azure role and it uses Azure diagnostic logging, then you must use full trust mode.

  4. Click the ellipsis (...) to set the Data Points Store Storage Account connection string in the Storage Account Connection String dialog. If you are hosting the block in an Azure role, select Use a connection string from the Service Configuration file and enter the name of a connection string in your Service Configuration File (.cscfg). If you are testing your autoscaling solution with the Azure Compute and Storage Emulators, select Use the Azure storage emulator. If you are hosting the block in an on-premises application, select Enter storage account credentials, and enter the account name and key for your Azure storage account.

    Note

    The block does not have support for storing the data points store in the local Azure storage emulator. The block uses an Azure API call that is not supported by the local storage emulator.

    Hh680915.F10A2953E5230E96CD067B252DE7E728(en-us,PandP.50).png

    Note

    Using HTTP could lead to disclosure of information and could allow someone to tamper with the data being transferred. You should use HTTPS in most cases.

  5. (Optional) In the Data Points Table Name box, you can change the name of the Azure table that the block uses to store the data points collected from your application. The default table name is AutoscalerDatapoints.

  6. (Optional) In the Rule Evaluation Rate box, you can change the rate at which the block evaluates your autoscaling rules. The default value is every four minutes.

Note

Each deployment of the Autoscaling Application Block must use its own data point store—either its own table in a shared storage account or a table in its own storage account.

Configuring the Rules Store

For more information about how the block uses the Rules Store, see the topic "Storing your Autoscaling Rules."

To configure the Rules Store

  1. To access the default Rules Store properties, click the section expander to the left of the Blob Rules Store title. The Type Name box shows that the block is using the default blob XML file rules store.

    Hh680915.B1306BE67063224E02437657EB9FCCE7(en-us,PandP.50).png

  2. (Optional) You can change the names of the Azure blob container and blob that the block uses to store autoscaling rule definitions.

    Note

    You may find it convenient to give the blob name a .xml file extension, so that it is recognized more easily by the XML editor you use to edit the rules.

  3. (Optional) You can specify the location, name, and thumbprint of the certificate that the block uses to decrypt the blob rules store. It is recommended that you encrypt the contents of the blob rules store. For more information about encrypting stores, see the topic "Encrypting the Rules Store and the Service Information Store."

  4. (Optional) You can specify that the block should request only valid certificates from the certificate store. An example of an invalid certificate is a certificate that has expired.

  5. (Optional) You can add the name of any extension's assemblies that implement custom actions or operands for reactive rules. For more information, see the topics "Creating a Custom Action" and "Creating a Custom Operand."

  6. (Optional) You can change the interval at which the block monitors the rules store for changes to the rule definitions. The default value is every 30 seconds to enable the block to pick up any changes within a reasonable time.

  7. Click the ellipsis (...) to set the Storage Account connection string for the rules store in the Storage Account Connection String dialog. If you are hosting the block in an Azure role, select Use a connection string from the Service Configuration file and enter the name of a connection string in your Service Configuration File (.cscfg). If you are testing your autoscaling solution with the Azure Compute and Storage Emulators, select Use the Azure storage emulator. If you are hosting the block in an on-premises application, select Enter storage account credentials, and enter the account name and key for your Azure storage account.

    Hh680915.F10A2953E5230E96CD067B252DE7E728(en-us,PandP.50).png

    Note

    Using HTTP could lead to disclosure of information and could allow someone to tamper with the data being transferred. You should use HTTPS in most cases.

  8. To change the rules store implementation to use local file storage, click the plus sign icon at the top right of the Rules Store panel and then click Set Rules Store. If you are hosting the block in an on-premises application, you may choose to store your autoscaling rules in a local file instead of in Azure storage.

    Hh680915.DD7077D7E3FFDB91FEE7F1B6E790631C(en-us,PandP.50).png

  9. To store your rules in a local file, click Use Local File Rules Store, and then click Yes to confirm the change. The Type Name box shows that the block is using the default local XML file rules store.

    Hh680915.9C01FB272C68ED8D36EF716E580A70FF(en-us,PandP.50).png

  10. (Optional) You can specify the location, name, and thumbprint of the certificate that the block uses to decrypt the file rules store. It is recommended that you encrypt the contents of the file rules store. For more information about encrypting stores, see the topic "Encrypting the Rules Store and the Service Information Store."

    Note

    To minimize the risk of disclosing information, you should protect the file using an access control list (ACL).

  11. (Optional) You can specify that the block should request only valid certificates from the certificate store. An example of an invalid certificate is a certificate that has expired.

  12. (Optional) You can add the name of any extension's assemblies that implement custom actions or operands for reactive rules. For more information, see the topics "Creating a Custom Action" and "Creating a Custom Operand."

  13. Click the ellipsis (...) to set the local file name for storing your autoscaling rules.

  14. To change the rules store implementation to use a custom rules store, click the plus sign icon at the top right of the Rules Store panel and then click Set Rules Store.

    Hh680915.DD7077D7E3FFDB91FEE7F1B6E790631C(en-us,PandP.50).png

  15. To store your rules in a custom rules store, click Use Custom Rules Store, and then click Yes to confirm the change. Use the Type Name box to identify the type of your custom rules store implementation.

    Hh680915.F4AD6FE1549E051F69C751DCE016AD46(en-us,PandP.50).png

  16. For information about how to create your own custom rules store, see the topic "Creating a Custom Rules Store."

For more information about the rules store, see the topic "Storing Your Autoscaling Rules."

Configuring the Service Information Store

For more information about how the block uses the service information store, see the topic "Storing Your Service Information Data."

To configure the Service Information Store

  1. To access the default Service Information Store properties, click the section expander to the left of the Blob Service Information Store title. The Type Name box shows that the block is using the default blob XML file service information store.

    Hh680915.80FAA15A38DE5AD7C9CE63B0AFE00667(en-us,PandP.50).png

  2. (Optional) You can change the names of the Azure blob container and blob that the block uses to store service information.

  3. (Optional) You can specify the location, name, and thumbprint of the certificate that the block uses to decrypt the blob service information store. It is recommended that you encrypt the contents this store. For more information about encrypting stores, see the topic "Encrypting the Rules Store and the Service Information Store."

  4. (Optional) You can specify that the block should request only valid certificates from the certificate store. An example of an invalid certificate is a certificate that has expired.

  5. (Optional) You can change the interval at which the block monitors the service information store for changes. The default value is every 30 seconds.

  6. Click the ellipsis (...) to set the Storage Account connection string for the rules store in the Storage Account Connection String dialog. If you are hosting the block in an Azure role, select Use a connection string from the Service Configuration file and enter the name of a connection string in your Service Configuration File (.cscfg). If you are testing your autoscaling solution with the Azure Compute and Storage Emulators, select Use the Azure storage emulator. If you are hosting the block in an on-premises application, select Enter storage account credentials, and enter the account name and key for your Azure storage account.

    Hh680915.F10A2953E5230E96CD067B252DE7E728(en-us,PandP.50).png

    Note

    Using HTTP could lead to disclosure of information and could allow someone to tamper with the data being transferred. You should use HTTPS in most cases.

  7. To change the service information store implementation to use local file storage, click the plus sign icon at the top right of the Service Information Store panel and then click Set Service Information Store. If you are hosting the block in an on-premises application, you may choose to store your service information in a local file instead of in Azure storage.

    Follow link to expand image

  8. To store your service information in a file on the local file system, click Use Local File Service Information Store, and then click Yes to confirm the change. The Type Name box shows that the block is using the default local file service information store.

    Hh680915.5822EF6A52CE6068CCC5BF8608CFF57E(en-us,PandP.50).png

  9. (Optional) You can change the name of the service information store settings. This name is used internally in the configuration file to link sections; you should not need to change it.

  10. (Optional) You can specify the location, name, and thumbprint of the certificate that the block uses to decrypt the local file service information store. It is recommended that you encrypt the contents of the local file service information store. For more information about encrypting stores, see the topic "Encrypting the Rules Store and the Service Information Store."

    Note

    To minimize the risk of disclosing information, you should protect the file using an ACL.

  11. (Optional) You can specify that the block should request only valid certificates from the certificate store. An example of an invalid certificate is a certificate that has expired.

  12. Click the ellipsis (...) to set the local file name for storing your service information.

  13. To change the service information store implementation to use a custom service information store, click the plus sign icon at the top right of the Service Information Store panel and then click Set Service Information Store.

    Follow link to expand image

  14. To use a custom store implementation for storing the service information, click Use Custom Service Information Store, and then click Yes to confirm the change. Use the Type Name box to identify the type of your custom service information store implementation.

    Hh680915.7CBE7917F8BD64594F462F63B866E9DA(en-us,PandP.50).png

  15. For information about how to create your own custom rules store, see the topic "Creating a Custom Service Information Store."

For more information about the service information store, see the topic "Storing Your Service Information Data."

Configuring the Service Management Request Tracker

For more information about the role of the Service Management Request Tracker, see the topic "The Request Tracking Process."

To configure the Service Management Request Tracker

  1. To access the Service Management Request Tracker properties, click the section expander to the left of the Service Management Request Tracker title in the Advanced Options panel.

    Hh680915.9D429DD9D107CB335FD684AD3CED29C1(en-us,PandP.50).png

  2. Click the ellipsis (...) to set the Storage Account connection string for the service management request tracker queue in the Storage Account Connection String dialog. If you are hosting the block in an Azure role, select Use a connection string from the Service Configuration file and enter the name of a connection string in your Service Configuration File (.cscfg). If you are hosting the block in an on-premises application, select Enter storage account credentials, and enter the account name and key for your Azure storage account. If you are testing your autoscaling solution with the Azure Compute and Storage Emulators, select Use the Azure storage emulator.

    Hh680915.F10A2953E5230E96CD067B252DE7E728(en-us,PandP.50).png

    Note

    Using HTTP could lead to disclosure of information and could allow someone to tamper with the data being transferred. You should use HTTPS in most cases.

  3. (Optional) You can change the interval at which the block runs the service management request tracker. The default value is five minutes.

  4. (Optional) You can enable the service management request tracker by setting the Track Requests property to True. By default, service management request tracking is disabled.

For more information about the service management request tracking, see the topic "Tuning the Autoscaling Application Block."

Configuring the Execution Lease

For more information about the role of the Execution Lease in the Autoscaling Application Block, see the topic "Tuning the Autoscaling Application Block."

To configure the Execution Lease

  1. To access the Execution Lease properties, click the section expander to the left of the Execution Lease title in the Advanced Options panel.

    Hh680915.9C494BCCE2224D485A714EBCE972DBB4(en-us,PandP.50).png

  2. (Optional) You can change the names of the Azure blob container and blob that the block uses for the blob execution lease.

  3. Click the ellipsis (...) to set the Storage Account connection string for the blob execution lease in the Storage Account Connection String dialog. If you are hosting the block in an Azure role, select Use a connection string from the Service Configuration file and enter the name of a connection string in your Service Configuration File (.cscfg). If you are testing your autoscaling solution with the Azure Compute and Storage Emulators, select Use the Azure storage emulator. If you are hosting the block in an on-premises application, select Enter storage account credentials, and enter the account name and key for your Azure storage account.

    Hh680915.F10A2953E5230E96CD067B252DE7E728(en-us,PandP.50).png

    Note

    Using HTTP could lead to disclosure of information and could allow someone to tamper with the data being transferred. You should use HTTPS in most cases.

  4. (Optional) You can enable the block to use a blob execution lease by setting the Use Blob Execution Lease property to True. By default, the block does not use a blob execution lease.

You must use a blob execution lease if you are hosting the block in an Azure worker role and plan to run multiple instances of that worker role. These configuration options enable the block to use a lease on an Azure blob to ensure that only a single instance of the block can execute the autoscaling rules at any one time.

For more information about blob execution leases, see the topic "Tuning the Autoscaling Application Block."

Configuring the Logger

To configure the Logger

  1. To view the default Source Logger properties, click the section expander to the left of the Source Logger title in the Logger panel. By default, the block uses the SystemDiagnosticLogger.

    Hh680915.8754209798453040AB052AD3766BC886(en-us,PandP.50).png

  2. To change the logger implementation that the block uses, click the plus sign icon at the top right of the Logger panel and then click Set Logger. You can choose to use the Enterprise Library Logging Application Block or a custom logger implementation.

    Hh680915.DBC488616FDFDBD87920026FAD06CAB6(en-us,PandP.50).png

For information about how to create your own custom logging implementation, see the topic "Creating a Custom Logger."

For information about the Enterprise Library Logging Application Block, see the topic "The Logging Application Block" on MSDN.

Note

To access Azure Diagnostics, you must run your role under full trust. For more information, see "Overview of Azure Diagnostics."

Next Topic | Previous Topic | Home

Last built: June 7, 2012