Utkarsh Srivastav
Utkarsh Srivastav

Reputation: 3227

Debugging Azure Service Fabric Application in Visual Studio for 5 node cluster

I am having a very simple use case where I need to setup a 5 node cluster environment in Azure Service Fabric and then debug the code.

The problem that I am facing is that when I deploy my application locally for a 5 node cluster, since there is only one node that can use my port on machine, my application just runs on 1 node cluster and the deployment fails on other 4 nodes because the port is unavailable.

I am looking for steps to deploy and test multi-node cluster in local environment. Any lead will be appreciated and is this possible also to test locally a multi-node Azure Service Fabric cluster.

Upvotes: 5

Views: 294

Answers (1)

LoekD
LoekD

Reputation: 11470

Can you try this?:

Use environment specific settings to define the port number:

  <ServiceManifestImport>
    <ServiceManifestRef ServiceManifestName="Web1Pkg" ServiceManifestVersion="1.0.0" />
    <ResourceOverrides>
      <Endpoints>
        <Endpoint Name="ServiceEndpoint" Port="[MyWebAPI_PortNumber]"/>
      </Endpoints>
    </ResourceOverrides>
    <ConfigOverrides />
  </ServiceManifestImport>

Define an empty default value in the app manifest, to use a random port by default:

<Parameters>
  <Parameter Name="MyWebAPI_PortNumber" DefaultValue="" />
</Parameters>

Define an environment specific override value in cloud.xml, to use port 80 in that environment:

  <Parameters>
    <Parameter Name="MyWebAPI_PortNumber" Value="80" />
  </Parameters>
  • In the production cluster you can use the same port on every node.
  • On your local 5-node development cluster, you'd use different ports.

More info here.

Upvotes: 3

Related Questions