gpt4 book ai didi

azure - 将 Azure 保留 IP 映射到云服务端点

转载 作者:行者123 更新时间:2023-12-03 00:11:52 25 4
gpt4 key购买 nike

我在 Azure 中有一个云服务辅助角色,该角色已使用保留 IP 地址进行设置。保留 IP 的目标是,当辅助角色发出外部请求时,它将始终来自同一 IP。该服务不接收外部流量,也不需要内部通信。

编辑:使用以下 Azure Powershell 命令将保留 IP 与云服务关联:

Set-AzureReservedIPAssociation -ReservedIPName uld-sender-ip -ServiceName uld-sender

添加了以下 NetworkConfiguration 部分到 .cscfg 文件中:

<NetworkConfiguration>
<AddressAssignments>
<ReservedIPs>
<ReservedIP name="uld-sender-ip" />
</ReservedIPs>
</AddressAssignments>
</NetworkConfiguration>

现在,当我尝试重新部署服务或更新 Azure 中的配置设置时,出现以下错误:

The operation '5e6772fae607ae0ca387457883bf2974' failed: 'Validation Errors: Error validating the .cscfg file against the .csdef file. Severity:Error, message:ReservedIP 'uld-sender-ip' was not mapped to an endpoint. The service definition must contain atleast one endpoint that maps to the ReservedIP..'.

因此,我尝试将端点添加到 .csdef 文件,如下所示:

<Endpoints>
<InternalEndpoint name="uld-sender-ip" protocol="tcp" port="8080" />
</Endpoints>

此外,我已将 NetworkTrafficRules 输入到 .csdef,如下所示:

<NetworkTrafficRules>
<OnlyAllowTrafficTo>
<Destinations>
<RoleEndpoint endpointName="uld-sender-ip" roleName="Sender"/>
</Destinations>
<AllowAllTraffic/>
</OnlyAllowTrafficTo>
</NetworkTrafficRules>

但我仍然遇到同样的错误。

我的理解是,端点仅用于工作人员/Web 角色之间的内部通信,或打开端口以接收外部通信。

编辑:我的问题是如何将保留 IP 映射到此场景的端点?

最佳答案

为了避免在尝试更新配置设置或重新部署服务时出现错误,我运行了 Azure Powershell 命令来删除与服务的保留 IP 关联:

Remove-AzureReservedIPAssociation -ReservedIPName uld-sender-ip -ServiceName uld-sender

然后我就能够在 Azure 中编辑和保存配置设置,和/或重新部署服务。服务更新后,我运行 Azure Powershell 命令来设置与服务的保留 IP 关联:

Set-AzureReservedIPAssociation -ReservedIPName uld-sender-ip -ServiceName uld-sender

这显然不是理想的解决方案,但至少我可以根据需要对服务进行更改。希望这对某人有帮助。

关于azure - 将 Azure 保留 IP 映射到云服务端点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44036256/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com