douwen9343 2014-08-15 01:42
浏览 72
已采纳

在计划上部署Azure云服务

  1. I want to host an Azure Website and I need to run a PHP script on the site every hour. Usually I would do something like this using cron jobs. Is Azure WebJobs via Azure Scheduler the only option to accomplish this?

  2. Using PHP or a REST API via PHP cURL, how do I create and deploy an Azure cloud service worker role to run some back-end PHP software independent of the website?

  3. How would pricing work for the cloud service? Would I only be paying while it is deployed, or would I be paying when it is created also? E.g. Could I create the service via Azure portal and deploy via PHP to get same pricing with less coding?

  4. How do I stop a cloud service once it is done processing?

  • 写回答

1条回答 默认 最新

  • doujun1495 2014-08-15 11:21
    关注
    1. You can use the Azure WebJobs under the website as you pointed out. You can also use the Azure scheduler direct and have it fire a call to another website or even an external system somewhere to kick something off. There is also a scheduler in the Azure Marketplace you could look at. Another option is the Azure Automation, which allows you to run a script separate from a web site or other deployment, though is PowerShell.

    2. You can create deployments using the Azure Management REST API. Here is some documentation on how to use the API from PHP. As for running this independent from the website, you'd either need to run this from an external system, or from a VM running within Azure.

    3. You pay for the Cloud Service from time it starts its deployment until the deployment is deleted. You pay only when something is deployed to the Cloud Service. If you create a cloud service via the portal or script, but don't deploy anything, then you aren't charged anything. When you deploy something into the cloud service you will be charged for as long as the deployment is there.

    4. Based on this question I'm assuming you mean the cloud service is some sort of back end processing. You could have the cloud service use the management api to shut itself down, but that would require that the management certificate be deployed with the cloud service, which some people don't like to do for security reasons. Other folks would have the worker roles push messages to an external system, or another service running in Azure, to say that they are done and it would then reach out and shut them down. There are really several options here depending on if you want it all managed in the cloud or have resources elsewhere that would perform the shutdown. The link to the management APIs above will give you "how to" shut them down, but the decision on what does that is really pretty open.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?
  • ¥15 c++头文件不能识别CDialog