Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

Hosting the Autoscaling Application Block in an On-Premises Application

On this page:
Usage Notes

This topic describes how to host the Autoscaling Application Block in a standalone on-premises application. This scenario is useful when you are testing and debugging your autoscaling solution. It is also useful if you need to integrate your autoscaling solution with existing on-premises applications such as a logging utility.

The Autoscaling Application Block uses rules to determine what scaling operations it should perform on your Windows Azure application and when. You must have a running Autoscaler instance that can perform the scaling operations. The following code sample shows how you can start an Autoscaler instance running in a simple console application.

using Microsoft.Practices.EnterpriseLibrary.Common.Configuration;
using Microsoft.Practices.EnterpriseLibrary.WindowsAzure.Autoscaling;

namespace AutoScalingConsoleApplication
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {

                Autoscaler scaler = 
                 EnterpriseLibraryContainer.Current.GetInstance<Autoscaler>();
                scaler.Start();
                while (true)
                {
                    System.Threading.Thread.Sleep(10000);
                    Console.WriteLine("running");
                }
            }
            catch (Exception exp)
            {
                Console.WriteLine(exp.Message);
                Console.Write(exp.StackTrace);
            }
            Console.ReadKey();
        }
    }
}
Hh680882.note(en-us,PandP.50).gifNote:
When you call the Start method of the Autoscaler class, the block attempts to read and parse the rules in your rules store. If any error occurs during the reading and validation of the rules, the block will log the exception with a "Rules store exception" message and continue. You should correct the error condition identified in the log message and save a new version of the rules to your rules store. The block will automatically attempt to load your new set of rules.

To understand and troubleshoot the block's behavior, you must use the log messages that the block writes. To ensure that the block can write log messages, you must configure logging for the host application. By default, the block uses the logging infrastructure from the System.Diagnostics namespace. The block can also use the Enterprise Library Logging Application Block or a custom logger.

For more information about how to configure the System.Diagnostics namespace logger or the Enterprise Library Logging Application Block logger, see the topic "Autoscaling Application Block Logging."

For more information about how to select the logging infrastructure that the Autoscaling Application Block should use, see the topic "Entering Configuration Information."

Usage Notes

Here is some additional information:

  • If you are running the Autoscaling Application Block in a console application, you must ensure that you configure the block with details of your Windows Azure application. You must run your Windows Azure application in Windows Azure to test the autoscaling behavior because the local Compute Emulator does not support the Windows Azure Service Management API.
  • If you are running the Autoscaling Application Block in a console application, you must ensure that the block can access the service information store and the rules store. You can configure the block to use local file system stores for the rules store and the service information store.
  • If you are running the Autoscaling Application Block in a console application, you must host the data points store in Windows Azure storage.
    Hh680882.note(en-us,PandP.50).gifNote:
    The block uses the upsert feature of Windows Azure table storage that is not supported by the local storage emulator.

  • If you are running the Autoscaling Application Block in a console application, you must ensure that you have the management certificate for the target application installed in the local certificate store and accessible to the application hosting the block. The service information model must correctly identify this certificate by thumbprint and location.

For more information about how to configure the block, see the topic "Entering Configuration Information."

Last built: June 7, 2012

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.