对Azure的云服务保留的IP不会保留 [英] Reserved IP for Azure Cloud Service doesn't persist

查看:177
本文介绍了对Azure的云服务保留的IP不会保留的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我挣扎去与保留的IP地址交手在Azure的云服务。

I'm struggling to get to grips with Reserved IP addresses in an Azure Cloud Service.

我有分期和生产部署的云服务,我至少需要生产部署有一个稳定的IP地址。我设置了2保留IP地址的描述这里然后被分配我的IP地址保留与电源外壳的生产和分期部署:

I have a Cloud Service with Staging and Productions deployments and I need at least the Production deployment to have a stable IP address. I set up 2 Reserved IP addresses as described here then assigned my reserved IPs to the Production and Staging deployments with Power Shell:

Set-AzureReservedIPAssociation -ReservedIPName MyReservedIP1 -ServiceName mycloudservice -Slot "Production"
Set-AzureReservedIPAssociation -ReservedIPName MyReservedIP2 -ServiceName mycloudservice -Slot "Staging"

都很好的保留的IP得到分配给各实例和交换保持正确的地址。现在的问题是,如果我删除部署之一,并重新部署的IP地址不能保持。

All well and good the reserved IPs get assigned to the respective instances and swapping maintains the correct addresses. The problem is if I delete one of the deployments and redeploy the IP address is not maintained.

我也试过不指定槽,并将其分配罚款,但似乎并没有得到生产或临时部署用来分配保留的IP地址到云服务。

I also tried assigning a reserved IP address to the cloud service without specifying a "Slot" and it assigned fine but does not seem to get used in either Production or Staging deployments.

Set-AzureReservedIPAssociation -ReservedIPName MyReservedIP -ServiceName mycloudservice

我通常的工作流程将部署到暂存,然后用生产交换一次我已经测试了所有工作正常。有了这个场景我怎么能保证生产部署总是得到保留的IP地址时,我从临时调换,即使有部署当前没有生产实例?

My usual workflow would be to deploy to Staging then swap with Production once I have tested all is working fine. With this scenario how can I ensure the Production deployment always gets a Reserved IP address when I swap from Staging, even if there is no current Production instance deployed?

Azure的文件说,为云服务的IP地址将是相同甚至资源关闭或释放,所以应该不是我的previously生产分配的IP地址也能保持如果我删除了生产实例,然后从临时交换?

The Azure documentation says "IP address for the cloud service will be the same even as resources are shutdown or deallocated" so shouldn't my previously assigned Production IP address be maintained even if I delete the Production instance and then swap from Staging?

推荐答案

这为我工作:

创建您的IP地址保留

新AzureReservedIP -ReservedIPNameIP1-Location东美2

新AzureReservedIP -ReservedIPNameIP2-Location东美2

部署到生产槽与您.cscfg文件中的以下网络配置:

Deploy to the production slot with the following network configuration in your .cscfg file:

<NetworkConfiguration>
    <AddressAssignments>
      <ReservedIPs>
        <ReservedIP name="ip1" />
      </ReservedIPs>
    </AddressAssignments>
  </NetworkConfiguration>

部署到具有以下配置的升级插槽:

Deploy to the staging slot with the following configuration:

<NetworkConfiguration>
    <AddressAssignments>
      <ReservedIPs>
        <ReservedIP name="ip2" />
      </ReservedIPs>
    </AddressAssignments>
  </NetworkConfiguration>

继续使用您的正常工作流程 - 部署到分期,然后交换到生产。 IP地址应该留在他们的插槽(IP1生产和IP2的分期)相关联。

Continue using your normal workflow - deploy to staging, then swap to production. The IP addresses should stay associated with their slots (ip1 in production and ip2 in staging).

这篇关于对Azure的云服务保留的IP不会保留的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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