Azure Autoscaling works locally but not when deployed

强颜欢笑 提交于 2019-12-17 20:01:57

问题


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

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

    What am I missing?

    Thanks


    回答1:


    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>
    



    回答2:


    For running in Azure I would try setting the Store Location to be LocalMachine.

    If you've followed all the steps in the Deploying the Autoscaling Application Block then the certificate with the private key (.pfx) should be deployed in the role. You can RDP into the server to verify that the certificate is installed (and the location).

    You can also try enabling logging as per Autoscaling Application Block Logging to see if there are any messages.



    来源:https://stackoverflow.com/questions/14448689/azure-autoscaling-works-locally-but-not-when-deployed

  • 易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
    该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!