Azure的:有什么办法来部署测试/生产不同尺寸的实例 [英] Azure: Is there any way to deploy different instance sizes for test/production

查看:192
本文介绍了Azure的:有什么办法来部署测试/生产不同尺寸的实例的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个将被部署到两个独立的托管服务的Windows Azure网站。一个用于测试,一个用于生产。当我们准备推到生产,我们旋转起来在生产服务分期部署,推动那里,然后做一个VIP掉。所有优秀的。

I have a Windows Azure site which is deployed to two separate hosted services. One for test, one for production. When we're ready to push to production, we spin up a staging deployment in the production service, push there, then do a VIP swap. All good.

现在的问题是,现在我们想从XS网络情况下拉升,但它并没有真正意义的花额外的钱在测试部署。有没有办法用一个XS实例测试,然后说中的实例进行生产?我知道我可以改变的实例数为每个服务的配置,但我只能改变实例的大小为所有的configs。

The question is, now we want to move up from XS web instances, but it doesn't really make sense to spend the extra money on the test deployment. Is there any way to use an XS instance for test, and then say medium instances for production? I know I can change the number of instances for each service config, but I can only change the instance size for all configs.

我想的只是留在XS的配置,然后记住它切换到中等之前,我部署到生产环境。是否有任何理由为什么我不应该这样做呢?有没有更好的办法?

I'm thinking of just leaving it XS in the config, and then remembering to switch it to Medium before I deploy to production. Is there any reason why I shouldn't do this? Is there a better way?

干杯!

推荐答案

有几个方法可以做到这一点...简单的方法是做一个小的CCPROJ文件的黑客

There are a few ways to do this... Simpler way is to do a little "hacking" of the CCPROJ file:

1)创建每个匹配的配置名称(发布/调试/ QA / UAT /等)环境下CSDEF文件的一个副本:
ServiceDefinition.Release.csdef,ServiceDefinition.Debug.csdef等。

1) create a clone of the CSDEF file for every environment that matches the Configuration Name (Release/Debug/QA/UAT/etc): ServiceDefinition.Release.csdef, ServiceDefinition.Debug.csdef, etc.

2)用记事本编辑器手动添加这些文件到文件CCPROJ

2) Add those files manually to the CCPROJ file by using a notepad editor

3)定义pre生成事件命令复制ServiceDefinition。$(ConfigurationName).csdef到ServiceDefintion.csdef

3) Define a Pre-Build Event command that copies the ServiceDefinition.$(ConfigurationName).csdef into ServiceDefintion.csdef

瞧,现在你的ServiceDefintion会适应你使用任何配置。

voila, now your ServiceDefintion will adapt to whatever configuration you're using.

如果你想获得票友,看看这个博客条目,可以帮助您切换各种设置齐声

If you want to get fancier, check out this blog entry that can help you switch all sorts of settings in unison

<一个href=\"http://www.paraleap.com/blog/post/Managing-environments-in-a-distributed-Azure-or-other-cloud-based-NET-solution.aspx\">http://www.paraleap.com/blog/post/Managing-environments-in-a-distributed-Azure-or-other-cloud-based-NET-solution.aspx

编辑:这是一个可行的配置。请注意,其他的文件被包括在类型为无,而不是ServiceDefinition避免多个定义错误

Here is a config that works. Notice that other files are included as type "None" instead of ServiceDefinition to avoid the multiple definitions error.

  <ItemGroup>
    <ServiceConfiguration Include="ServiceConfiguration.Local.cscfg" />
    <ServiceConfiguration Include="ServiceConfiguration.Development 1.cscfg" />
    <ServiceConfiguration Include="ServiceConfiguration.Development 2.cscfg" />
    <ServiceConfiguration Include="ServiceConfiguration.Local Dev 1.cscfg" />
    <ServiceConfiguration Include="ServiceConfiguration.Local Dev 2.cscfg" />
    <ServiceConfiguration Include="ServiceConfiguration.QA 1.cscfg" />
    <ServiceConfiguration Include="ServiceConfiguration.QA 2.cscfg" />
    <ServiceConfiguration Include="ServiceConfiguration.Pre-Production 1.cscfg" />
    <ServiceConfiguration Include="ServiceConfiguration.Production.cscfg" />
    <ServiceDefinition Include="ServiceDefinition.csdef" />
    <None Include="ServiceDefinition.Local.csdef" />
    <None Include="ServiceDefinition.Development 1.csdef" />
    <None Include="ServiceDefinition.Development 2.csdef" />
    <None Include="ServiceDefinition.Local Dev 1.csdef" />
    <None Include="ServiceDefinition.Local Dev 2.csdef" />
    <None Include="ServiceDefinition.QA 1.csdef" />
    <None Include="ServiceDefinition.QA 2.csdef" />
    <None Include="ServiceDefinition.Pre-Production 1.csdef" />
    <None Include="ServiceDefinition.Production.csdef" />
  </ItemGroup>

这篇关于Azure的:有什么办法来部署测试/生产不同尺寸的实例的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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