2016-12-17 90 views
3

我有一個雲端服務,可以在外部打開一個套接字並且需要列入白名單的IP地址。沒有任何東西會從外部啓動與我的服務的連接。沒有端點的Azure ReservedIPAddress&Cloud Service

當我嘗試與相關ReservedIP地址我收到以下錯誤發佈:Validation Errors: Error validating the .cscfg file against the .csdef file. Severity:Error, message:ReservedIP 'xxxx' was not mapped to an endpoint. The service definition must contain atleast one endpoint that maps to the ReservedIP..

.cscfg

<?xml version="1.0" encoding="utf-8"?> 
<ServiceConfiguration serviceName="Gateway" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceConfiguration" osFamily="5" osVersion="*" schemaVersion="2015-04.2.6"> 
    <Role name="WorkerRole1"> 
    <Instances count="1" /> 
    <ConfigurationSettings> 
     <Setting name="Microsoft.WindowsAzure.Plugins.Diagnostics.ConnectionString" value="yyyyy" /> 
     <Setting name="APPINSIGHTS_INSTRUMENTATIONKEY" value="xxx" /> 
     <Setting name="ASPNETCORE_ENVIRONMENT" value="dev" /> 
    </ConfigurationSettings> 
    </Role> 
    <NetworkConfiguration> 
    <AddressAssignments> 
     <ReservedIPs> 
     <ReservedIP name="xxxxx"/> 
     </ReservedIPs> 
    </AddressAssignments> 
    </NetworkConfiguration> 
</ServiceConfiguration> 
  1. 是否有不指定端點部署這個辦法? (我正在使用VS2017RC進行部署)
  2. 如果不是,那麼對於虛擬「端點」,xml看起來會是什麼樣子?我將如何運行這些操作?
  3. 有沒有更好的方法我應該接近這個?

回答

3

看起來像ReservedIP僅支持包含外部端點的服務。你可以做的是添加一個外部端點,但是用NSG(Network Security Group)關閉它。

在幫助定義端點看到

https://docs.microsoft.com/en-us/azure/cloud-services/cloud-services-enable-communication-role-instances

另外,如果你使用的是實際上沒有在機器綁定到指定端口,它不應該是一個漏洞;但是在NSG中添加拒絕規則將覆蓋未來的任何變化。

[Aside]如果您的服務沒有任何傳入連接,則應考慮使用輔助角色而不是Web角色。長時間運行的線程可能會在Web角色實例中終止。

+0

與虛擬端點一起去修復ReservedIP。感謝您的額外信息。 – Prescott

4

我遇到了同樣的問題,我的工作解決方案是從here取得「輸入端點」,並將其放置在WorkerRole標籤內的.csdef文件中。

<Endpoints> 
    <InputEndpoint name="StandardWeb" protocol="http" port="80" localPort="80" /> 
</Endpoints> 
+0

您是否可以在您的答案中包含代碼,以防萬一您提到的鏈接發生變化? –

相關問題