Search code examples
azureazure-service-fabric

How do I deploy my Azure Service Fabric application to the local cluster consistently and successfully?


I am deploying and redeploying Azure Service Fabric applications in a local cluster. While initial deployment to the cluster went smoothly, redeployment results in about a 50% success rate with various intermittent errors.

Errors in the output window of Visual Studio:

  • Unable to determine whether the application is installed on the cluster or not.

  • Something is taking too long, the application is still not ready.

Errors in Service Fabric Explorer (SFX):

  • One application instance OK, the other shows an error

    One application instance OK, the other shows an error

  • Error in fabric:/System/DnsService: DnsService UDP Listener is unable to start

    Error in fabric System DnsService

  • Error in fabric:/System/EventStoreService: System.Net.HttpListenerException

    Error in fabric System Event Store Service

How do I deploy my application to the local cluster consistently and successfully?


Solution

  • In Visual Studio's Properties window, change the Application Debug Mode from Refresh to Remove Application.

    Application Debug Mode Remove Application

    I deployed my app 10 times in a row with no errors!

    Caveat: The one disadvantage to this solution is that if you remove your local cluster and then redeploy, Service Fabric Explorer (SFX) will throw several errors for a few minutes such as Get cluster upgrade progress failed

    Get cluster upgrade progress failed