[英]Map Azure Reserved IP to Endpoint for Cloud Service
我在Azure中擁有一個Cloud Service Worker角色,該角色已設置為保留的IP地址。 保留IP的目標是當工作者角色發出外部請求時,它總是來自同一個IP。 該服務不接收外部流量,也不需要內部通信。
編輯 :使用以下Azure Powershell命令將保留的IP與Cloud Service相關聯:
Set-AzureReservedIPAssociation -ReservedIPName uld-sender-ip -ServiceName uld-sender
這將以下NetworkConfiguration部分添加到.cscfg文件中:
<NetworkConfiguration>
<AddressAssignments>
<ReservedIPs>
<ReservedIP name="uld-sender-ip" />
</ReservedIPs>
</AddressAssignments>
</NetworkConfiguration>
現在,當我嘗試重新部署服務或更新Azure中的配置設置時,我收到以下錯誤:
操作'5e6772fae607ae0ca387457883bf2974'失敗:'驗證錯誤:針對.csdef文件驗證.cscfg文件時出錯。 嚴重性:錯誤,消息:ReservedIP'udl-sender-ip'未映射到端點。 服務定義必須包含至少一個映射到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
這顯然不是理想的解決方案,但至少我可以根據需要對服務進行更改。 希望這有助於某人。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.