microsoft / service-fabric-issues

This repo is for the reporting of issues found with Azure Service Fabric.
168 stars 21 forks source link

Url Missing ApplicationName and ServiceName #1543

Closed githubkelv closed 5 years ago

githubkelv commented 5 years ago

Not sure if it's a bug or a code problem. Been stuck for a few days.

Development environment Win10 Professional IDE: Visual Studio 2019 Dotnet core 2.1

Windows Cluster Created a Service Fabric Application -> Create Stateless ASP.NET core service. Deployed to Service Fabric Cluster and able to access the api. localhost:4000/ServiceFabricApp/MyService/api/values

Linux Cluster Using the same project, update MyService.csproj to ubuntu as i'm using linux

ubuntu.16.04-x64

Removed .exe from ServiceManifest.xml

  <CodePackage Name="Code" Version="1.0.1">
    <EntryPoint>
      <ExeHost>
        <!--Remove .exe if deploying to linux-->
        <Program>MyService</Program>
        <WorkingFolder>CodePackage</WorkingFolder>
      </ExeHost>
    </EntryPoint>

Deploy to linux cluster and i'm unable to access localhost:4000/ServiceFabricApp/MyService/api/values Instead I can only access it through localhost:4000/api/values

My app works but the ApplicationName and ServiceName is missing from the url. I expected the exact same project to work the same regardless if deployed on a windows cluster/Linux Cluster. Keep in mind that the code is exactly the same (Whatever was generated on a new web api project) and only changes was to the settings to let it run on linux server.

This happen on both Azure Cluster and Local cluster

githubkelv commented 5 years ago

Closing this as I found out it's due to reverse proxy. Windows server has it but not on linux thus with reverse proxy, the services hosted on windows server can be access via localhost:port/appname/servicename/api/values