Azure的检测分期与生产 [英] Azure Detect Staging vs Production

查看:110
本文介绍了Azure的检测分期与生产的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有一种方法来检测,如果一个工人的作用是分期或生产。

Is there a way to detect if a worker role is in staging or production.

我想,直到它被交换到生产,这样做是为了在上演环境苏preSS功能,那么燮preSS在去productioned的版本相同的功能。

I want to do this to supress functionality in the staged environment until it is swapped to production and then suppress the same functionality in the "de-productioned" version.

的stagged environemnt只存在使得新版本可以是pre上载到确保交换过是准时和零停机时间,则previous版本然后停止而附加的质量检查是performened然后被删除

The stagged environemnt only exists so that the new version can be pre uploaded to ensure that the swap over is ontime and with zero downtime, the previous version is then stopped while additional QA is performened and then deleted.

感谢

韦恩

推荐答案

您可以通过使用服务管理REST API调用这样做。你可以做的就是让托管服务( HTTP的属性:// MSDN。 microsoft.com/en-us/library/ee460806.aspx )与嵌入的细节=真正的查询参数。这将会为您提供有关托管服务的部署细节。你感兴趣的是,在部署节点,这将给你部署ID。你可以用你RoleEnvironment类得到部署ID(<一个比较这href=\"http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleenvironment_members.aspx\" rel=\"nofollow\">http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleenvironment_members.aspx)并利用他们都可以找到,如果你的部署情况分期或生产运行插槽

You can do so by using Service Management REST API calls. What you can do is get the properties of the hosted service (http://msdn.microsoft.com/en-us/library/ee460806.aspx) with embed-details=true query parameter. This will give you details about the hosted service deployments. What you're interested in is "" node under deployment which will give you your deployment id. You can compare this with the deployment id you get from RoleEnvironment class (http://msdn.microsoft.com/en-us/library/microsoft.windowsazure.serviceruntime.roleenvironment_members.aspx) and using both of them you can find out if your deployment is running in staging or production slot.

希望这有助于。

这篇关于Azure的检测分期与生产的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆