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 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示
  • ¥15 求三国群英传pl国战时间的修改方法
  • ¥15 matlab代码代写,需写出详细代码,代价私
  • ¥15 ROS系统搭建请教(跨境电商用途)
  • ¥15 AIC3204的示例代码有吗,想用AIC3204测量血氧,找不到相关的代码。