Search code examples
deploymentazureenterprise-libraryautoscaling

Azure Autoscaling works locally but not when deployed


Problem

I am trying to deploy a worker role which will autoscale a few target sites. I am able to run the autoscaler locally and it works (I installed the certificates on my machine). However, it won't autoscale once I deploy it to Azure as a cloud app. (However, the worker role is running because I can see my non-autoscaling processes working in the same worker role.)

What I tried

I have followed the Deploying the Autoscaling Application Block instructions.

  • Added the "CN=Windows Azure Tools" certificate to the management certificates of the target subscription.
  • Added the "CN=Windows Azure Tools" certificate to the autoscaling application's certificates.
  • Specified the location of my cert in the worker role Worker role certificates

  • Specified the location of the cert in my service store for configuring autoscaling

    Service store configuration

    What am I missing?

    Thanks


  • Solution

  • Tuzo is right - cert should be in LocalMachine, but that's not enough. See this SO post. Basically, in OS Family 2, WaWorkerHost is running under a temporary account (with a GUID name) generated by Role initialization process, this account has permission to access certificate private key; In OS Family 3, WaWorkerHost is running under “NETWORK SERVICE” account, this account doesn’t have private key access permission.

    Best option for now (MS Azure team addressing issue in next SDK) is to run the role with elevated privileges - edit ServiceDefinition.csdef:

    <?xml version="1.0" encoding="utf-8"?>
    <ServiceDefinition name="blah" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-10.1.8">
      <WorkerRole name="blah" vmsize="Small">
        <Runtime executionContext="elevated" />
        ...      
       </WorkerRole>
    </ServiceDefinition>